Mozilla.com

Table of contents
  1. 1. Syntax
  2. 2. Description
  3. 3. Example
Table of contents
  1. 1. Syntax
  2. 2. Description
  3. 3. Example

Determines if a given jsval is a string.

Syntax

JSVAL_IS_STRING(v)

Description

JSVAL_IS_STRING(v) is true if v is a string.

To access the content of a string jsval, use JSVAL_TO_STRING, JS_GetStringChars, and JS_GetStringLength.

Example

The following code snippet illustrates how a JavaScript variable, MyItem, is conditionally tested in an if statement to see if it is a string.

if (JSVAL_IS_STRING(MyItem)) {
    ...
}

LXR ID Search

Page last modified 20:11, 5 Sep 2008 by Jorend

Files (0)