tencent cloud

Feedback

WXS

Last updated: 2024-03-04 23:15:26
    WXS (WeiXin Script) is a scripting language for mini-programs that, when combined with WXML, can be utilized to construct the structural framework of a page.

    Supports and Limits

    WXS is not reliant on the version of the runtime library, thus it can operate across all versions of mini-programs.
    WXS and JavaScript are distinct languages, each possessing its own unique syntax, and are not consistent with each other.
    The execution environment of WXS is isolated from other JavaScript codes. Functions defined in other JavaScript files cannot be invoked within WXS, nor can it call upon the APIs provided by the mini-program.
    WXS functions cannot serve as event callbacks for components.
    Due to differences in operating environments, WXS within mini-programs on iOS devices can run 2 to 20 times faster than JavaScript code. On Android devices, there is no difference in the efficiency of their execution.
    Here are some simple examples of using WXS:

    Page Rendering

    <!-- wxml -->
    <wxs module="m1">
    var msg = "hello world";
    module.exports.message = msg;
    </wxs>
    
    <view>{{m1.message}}</view>
    Page Output:
    hello world

    Data Processing

    // page.js
    Page({
    data: {
    array: [1, 2, 3, 4, 5, 1, 2, 3, 4],
    },
    })
    <!-- wxml -->
    <!-- The following getMax function accepts an array and returns the value of the largest element in the array -->
    <wxs module="m1">
    var getMax = function(array) {
    var max = undefined;
    for (var i = 0; i < array.length; ++i) {
    max = max === undefined ? array[i] : (max >= array[i] ? max : array[i]);
    }
    return max;
    }
    module.exports.getMax = getMax;
    </wxs>
    
    <!-- Invoke the getMax function within WXS, with the parameter being the array in page.js -->
    <view>{{m1.getMax(array)}}</view>
    Page Output:
    5
    

    Module

    WXS Module

    WXS code can be written within the <wxs> tag in a wxml file, or within a file with a .wxs extension.

    Module

    Each .wxs file and <wxs> tag constitutes an individual module.
    Each module possesses its own independent scope. That is, variables and functions defined within a module are, by default, private and invisible to other modules.
    In order for a module to expose its internal private variables and functions, it can only be accomplished through module.exports.

    .WXS File

    Within the developer tool, a .wxs file can be directly created by right-clicking, allowing for the immediate scripting of WXS.
    Sample Code:
    // /pages/comm.wxs
    
    var foo = "'hello world' from comm.wxs"
    var bar = function(d) {
    return d
    }
    module.exports = {
    foo: foo,
    bar: bar,
    }
    The aforementioned example scripts WXS code within the /pages/comm.wxs file. This .wxs file can be referenced by other .wxs files or by the <wxs> tag within WXML.

    Module Object

    Each wxs module possesses an inherent module object.
    Attribute
    Exports: This attribute allows the sharing of private variables and functions from this module to the outside.
    Sample Code:
    // /pages/tools.wxs
    
    var foo = "'hello world' from tools.wxs"
    var bar = function(d) {
    return d
    }
    module.exports = {
    FOO: foo,
    bar: bar,
    }
    module.exports.msg = 'some msg'
    <!-- page/index/index.wxml -->
    
    <wxs src="./../tools.wxs" module="tools" />
    <view>{{tools.msg}}</view>
    <view>{{tools.bar(tools.FOO)}}</view>
    Page Output:
    some msg
    'hello world' from tools.wxs

    Require Function

    In a .wxs module, to reference other wxs file modules, the require function can be utilized.
    When referencing, the following points should be taken into consideration:
    Only .wxs file modules can be referenced, and it is imperative to use a relative path.
    wxs modules operate on a singleton pattern, meaning they are automatically initialized as singleton objects upon the first reference. Regardless of multiple pages, multiple locations, or multiple references, the same wxs module object is utilized.
    If a wxs module is not referenced after its definition, the module will not be parsed or executed.
    Sample Code:
    // /pages/tools.wxs
    
    var foo = "'hello world' from tools.wxs"
    var bar = function(d) {
    return d
    }
    module.exports = {
    FOO: foo,
    bar: bar,
    }
    module.exports.msg = 'some msg'
    // /pages/logic.wxs
    
    var tools = require('./tools.wxs')
    
    console.log(tools.FOO)
    console.log(tools.bar('logic.wxs'))
    console.log(tools.msg)
    <!-- /page/index/index.wxml -->
    
    <wxs src="./../logic.wxs" module="logic" />
    Console Output:
    'hello world' from tools.wxs
    logic.wxs
    some msg

    <WXS> Tag

    Attribute
    Types
    Default value
    module
    string
    The module name of the current <wxs> tag. This is a mandatory field.
    src
    string
    The relative path to the .wxs file. This is only applicable when the tag is either a self-closing tag or a tag with no content.
    Module Attribute
    The module attribute is the module name of the current <wxs> tag. Within a single wxml file, it is recommended that its value be unique. If there are duplicate module names, they will be overwritten in the order they appear (the latter overwrites the former). WXS module names from different files will not overwrite each other.
    The naming of the module attribute value must adhere to the following two rules:
    The first character must be: a letter (a-zA-Z), or an underscore (_).
    The remaining characters can be: letters (a-zA-Z), underscores (_), or numbers (0-9).
    Sample Code:
    <!-- wxml -->
    
    <wxs module="foo">
    var some_msg = "hello world";
    module.exports = { msg : some_msg, }
    </wxs>
    <view>{{foo.msg}}</view>
    Page Output:
    hello world
    Src Attribute
    The src attribute can be used to reference modules from other wxs files.
    When referencing, the following points should be taken into consideration:
    Only .wxs file modules can be referenced, and it is imperative to use a relative path.
    wxs modules operate on a singleton pattern, meaning they are automatically initialized as singleton objects upon the first reference. Regardless of multiple pages, multiple locations, or multiple references, the same wxs module object is utilized.
    If a wxs module is not referenced after its definition, the module will not be parsed or executed.
    Sample Code:
    // /pages/index/index.js
    
    Page({
    data: {
    msg: "'hello wrold' from js",
    },
    })
    <!-- /pages/index/index.wxml -->
    
    <wxs src="./../comm.wxs" module="some_comms"></wxs>
    <!-- The self-closing tag syntax can also be used directly: <wxs src="./../comm.wxs" module="some_comms" /> -->
    
    <!-- Invoke the bar function within the some_comms module, with the argument being foo from the some_comms module -->
    <view>{{some_comms.bar(some_comms.foo)}}</view>
    <!-- Invoke the bar function within the some_comms module, with the argument being msg from page/index/index.js -->
    <view>{{some_comms.bar(msg)}}</view>
    Page Output:
    'hello world' from comm.wxs
    'hello wrold' from js
    The aforementioned example references the /page/comm.wxs module in the /page/index/index.wxml file via the <wxs> tag.
    Note:
    <wxs> modules can only be accessed in the WXML file where they are defined. When using <include> or <import>, <wxs> modules will not be imported into the corresponding WXML file.
    Within the <template> tag, only <wxs> modules defined in the WXML file where the <template> is defined can be used.

    variables

    Concept

    In WXS, all variables are references to values.
    Variables that are used directly without declaration will be defined as global variables.
    If a variable is declared but not assigned a value, the default value is undefined.
    The behavior of 'var' is consistent with JavaScript, exhibiting variable hoisting.
    var foo = 1
    var bar = 'hello world'
    var i // i === undefined
    In the aforementioned code, three variables, foo, bar, and i, are declared. Subsequently, foo is assigned the numeric value 1, and bar is assigned the string "hello world".

    Variable

    Variable naming must adhere to the following two rules:
    The initial character must be: a letter (a-zA-Z) or an underscore (_).
    The remaining characters can be: letters (a-zA-Z), underscores (_), or numbers (0-9).

    Reserved Identifiers

    The following identifiers cannot be used as variable names:
    delete
    void
    typeof
    null
    undefined
    NaN
    Infinity
    var
    if
    else
    true
    false
    require
    this
    function
    arguments
    return
    for
    while
    do
    break
    continue
    switch
    case
    default

    Remarks

    There are primarily three methods of commenting in WXS.
    Sample Code:
    <!-- wxml -->
    <wxs module="sample">
    // Method One: Single-line Comments
    /* Method Two: Multi-line Comments */
    /* Method Three: End Comments. That is, all WXS code following /* is commented out. var a = 1; var b = 2; var c = "fake";
    </wxs>
    In the aforementioned example, all the WXS code has been commented out.
    Note:
    The sole distinction between Method Three and Method Two is the absence of the */ termination symbol.

    Operators

    Fundamental Operators

    Sample Code:
    var a = 10, b = 20
    
    // Addition Operation
    console.log(30 === a + b)
    // Subtraction Operation
    console.log(-10 === a - b)
    // Multiplication Operation
    console.log(200 === a * b)
    // Division Operation
    console.log(0.5 === a / b)
    // Modulus Operation
    console.log(10 === a % b)
    Furthermore: The addition operation (+) can also be utilized for string concatenation.
    var a = '.q', b = 's'
    
    // String Concatenation
    console.log('.wxs' === a + b)

    Unary Operator

    Sample Code:
    var a = 10, b = 20
    
    // Increment Operation
    console.log(10 === a++)
    console.log(12 === ++a)
    // Decrement Operation
    console.log(12 === a--)
    console.log(10 === --a)
    // Positive Value Operation
    console.log(10 === +a)
    // Negative Value Operation
    console.log(0 - 10 === -a)
    // Negation Operation
    console.log(-11 === ~a)
    // Inversion Operation
    console.log(false === !a)
    // Delete Operation
    console.log(true === delete a.fake)
    // Void Operation
    console.log(undefined === void a)
    // Typeof Operation
    console.log('number' === typeof a)

    Bitwise Operators

    Sample Code:
    var a = 10, b = 20
    
    // Left Shift Operation
    console.log(80 === a << 3)
    // Unsigned Right Shift Operation
    console.log(2 === a >> 2)
    // Signed Right Shift Operation
    console.log(2 === a >>> 2)
    // AND Operation
    console.log(2 === (a & 3))
    // XOR Operation
    console.log(9 === (a ^ 3))
    // OR Operation
    console.log(11 === (a | 3))

    Comparison operator

    Sample Code:
    var a = 10, b = 20
    
    // Less Than
    console.log(true === a < b)
    // Greater Than
    console.log(false === a > b)
    // Less Than or Equal To
    console.log(true === a <= b)
    // Greater Than or Equal To
    console.log(false === a >= b)

    Equality operator

    Sample Code:
    var a = 10, b = 20
    
    // Equal Sign
    console.log(false === (a == b))
    // Not Equal Sign
    console.log(true === (a != b))
    // Identical Sign
    console.log(false === (a === b))
    // Not Identical Sign
    console.log(true === (a !== b))

    Assignment operator

    Sample Code:
    var a = 10
    
    a = 10
    a *= 10
    console.log(100 === a)
    a = 10
    a /= 5
    console.log(2 === a)
    a = 10
    a %= 7
    console.log(3 === a)
    a = 10
    a += 5
    console.log(15 === a)
    a = 10
    a -= 11
    console.log(-1 === a)
    a = 10
    a <<= 10
    console.log(10240 === a)
    a = 10
    a >>= 2
    console.log(2 === a)
    a = 10
    a >>>= 2
    console.log(2 === a)
    a = 10
    a &= 3
    console.log(2 === a)
    a = 10
    a ^= 3
    console.log(9 === a)
    a = 10
    a |= 3
    console.log(11 === a)

    Binary Logical Operator

    Sample Code:
    var a = 10, b = 20
    
    // Logical AND
    console.log(20 === (a && b))
    // Logical OR
    console.log(10 === (a || b))

    Additional Operators

    Sample Code:
    var a = 10, b = 20
    
    // Conditional Operator
    console.log(20 === (a >= 10 ? a + 10 : b + 10))
    // Comma Operator
    console.log(20 === (a, b))

    Operator Precedence

    Priority
    Operators
    Note
    Associativity
    20
    ( ... )
    Parentheses
    n/a
    19
    ... . ...
    Member Access
    Left-to-right
    ...[ ... ]
    Member Access
    Left-to-right
    ... ( ... )
    Function invocation
    Left-to-right
    17
    ... ++
    Postfix Increment
    n/a
    ...--
    Postfix Decrement
    n/a
    16
    ! ...
    Logical NOT
    Right-to-left
    ~ ...
    Bitwise NOT
    Right-to-left
    + ...
    Unary Addition
    Right-to-left
    - ...
    Unary subtraction
    Right-to-left
    ++ ...
    Prefix Increment
    Right-to-left
    -- ...
    Prefix Decrement
    Right-to-left
    typeof ...
    typeof
    Right-to-left
    void ...
    void
    Right-to-left
    delete ...
    delete
    Right-to-left
    14
    ... * ...
    Multiplication
    Left-to-right
    ... / ...
    Division
    Left-to-right
    ... % ...
    Modulus
    Left-to-right
    13
    ... + ...
    Addition
    Left-to-right
    ... - ...
    Subtraction
    Left-to-right
    12
    ... << ...
    Bitwise Left Shift
    Left-to-right
    ... >> ...
    Bitwise Right Shift
    Left-to-right
    ... >>> ...
    Unsigned Right Shift
    Left-to-right
    11
    ... < ...
    <
    Left-to-right
    ... <= ...
    < or =
    Left-to-right
    ... > ...
    >
    Left-to-right
    10
    ... == ...
    Greater or equal to
    Left-to-right
    ... != ...
    Equal to
    Left-to-right
    ... === ...
    Not equal to
    Left-to-right
    ... !== ...
    Identically equal to
    Left-to-right
    9
    ... & ...
    Bitwise AND
    Left-to-right
    8
    ... ^ ...
    Bitwise XOR
    Left-to-right
    7
    ... ...
    Bitwise OR
    Left-to-right
    6
    ... && ...
    Logical OR
    Left-to-right
    5
    ... || ...
    Logical AND
    Left-to-right
    4
    ... ? ... ...
    Conditional Operators
    Right-to-left
    3
    ... = ...
    Assignment
    Right-to-left
    ... += ...
    Assignment
    Right-to-left
    ... -= ...
    Assignment
    Right-to-left
    ... *= ...
    Assignment
    Right-to-left
    .../= ...
    Assignment
    Right-to-left
    ... %= ...
    Assignment
    Right-to-left
    ... <<= ...
    Assignment
    Right-to-left
    ... >>= ...
    Assignment
    Right-to-left
    ... >>>= ...
    Assignment
    Right-to-left
    ... &= ...
    Assignment
    Right-to-left
    ... ^= ...
    Assignment
    Right-to-left
    ... |= ...
    Assignment
    Right-to-left
    0
    ... , ...
    Comma
    Left-to-right

    Statement

    If Statement

    In WXS, the following format of the 'if' statement can be utilized:
    If (expression) statement: Execute statement when expression is truthy.
    If (expression) statement1 else statement2: Execute statement1 when expression is truthy. Otherwise, execute statement2.
    If ... else if ... else statementN: This construct allows for the selection and execution of one among statement1 ~ statementN.
    Example Syntax:
    // if ...
    
    if (expression) statement
    
    if (expression) statement
    
    if (expression) {
    Code Block
    }
    
    // if ... else
    
    if (expression) statement
    else statement
    
    if (expression) statement
    else statement
    
    if (expression) {
    Code Block
    } else {
    Code Block
    }
    
    // if ... else if ... else ...
    
    if (expression) {
    Code Block
    } else if (expression) {
    Code Block
    } else if (expression) {
    Code Block
    } else {
    Code Block
    }

    switch statement

    Example Syntax:
    switch (expression) {
    case variable:
    Statement
    case number:
    Statement
    break
    case string:
    Statement
    default:
    Statement
    }
    Sample Code:
    var exp = 10
    
    switch (exp) {
    case '10':
    console.log('string 10')
    break
    case 10:
    console.log('number 10')
    break
    case exp:
    console.log('var exp')
    break
    default:
    console.log('default')
    }
    Output:
    number 10

    for statement

    Example Syntax:
    for (statement; statement; statement) statement
    
    for (statement; statement; statement) {
    Code Block
    }
    Supports the use of break,continue keywords.
    Sample Code:
    for (statement; statement; statement) statement
    
    for (statement; statement; statement) {
    Code Block
    }
    Output:
    0
    1

    while statement

    Example Syntax:
    while (expression) statement
    
    while (expression) {
    Code Block
    }
    
    do {
    Code Block
    } while (expression)

    Data Types

    The WXS language currently encompasses the following data types:
    Types
    Note
    number
    Numerical value
    string
    String
    boolean
    Boolean Value
    object
    Object
    function
    Function
    array
    Array
    date
    Date
    regexp
    Regex

    number

    Syntax
    The term 'number' encompasses two types of values: integers and decimals.
    var a = 10
    var PI = 3.141592653589793
    Attribute
    constructor: Returns the string "Number".
    Method
    toString
    toLocaleString
    valueOf
    toFixed
    toExponential
    toPrecision
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.

    string

    Syntax
    There are two ways to write a string:
    'hello world'
    
    Attribute
    constructor: Returns the string "String".
    length
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.
    Method
    toString
    valueOf
    charAt
    charCodeAt
    concat
    indexOf
    lastIndexOf
    localeCompare
    match
    replace
    search
    slice
    split
    substring
    toLowerCase
    toLocaleLowerCase
    toUpperCase
    toLocaleUpperCase
    trim
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.

    boolean

    Syntax
    Boolean values have only two specific values: true and false.
    Attribute
    constructor: Returns the string "Boolean".
    Method
    toString
    valueOf
    Note:
    For specific usage of the above methods, please refer to the ES5 standard.

    object

    Syntax
    An object is an unordered set of key-value pairs. The usage is as follows:
    var o = {} // Generates a new empty object
    
    // Generates a new non-empty object
    o = {
    string: 1, // The key of an object can be a string
    const_var: 2, // The key of an object can also be an identifier that complies with variable definition rules
    func: {}, // The value of an object can be of any type
    }
    
    // Read operation of object properties
    console.log(1 === o['string'])
    console.log(2 === o.const_var)
    
    // Write operation of object properties
    o['string']++
    o['string'] += 10
    o.const_var++
    o.const_var += 10
    
    // Read operation of object properties
    console.log(12 === o['string'])
    console.log(13 === o.const_var)
    Attribute
    constructor: Returns the string "Object"
    console.log('Object' === { k: '1', v: '2' }.constructor)
    Method
    toString: Returns the string "[object Object]"

    function

    Syntax
    The function supports the following definition methods:
    // Method 1
    function a(x) {
    return x
    }
    
    // Method 2
    var b = function(x) {
    return x
    }
    The function also supports the following syntax (such as anonymous functions, closures, etc.):
    var a = function(x) {
    return function() {
    return x
    }
    }
    
    var b = a(100)
    console.log(100 === b())

    arguments

    Within the function, the arguments keyword can be used. Currently, this keyword only supports the following properties:
    length: The number of arguments passed to the function.
    [index]: Each argument passed to the function can be iterated through using the index subscript.
    Sample Code:
    var a = function() {
    console.log(3 === arguments.length)
    console.log(100 === arguments[0])
    console.log(200 === arguments[1])
    console.log(300 === arguments[2])
    }
    a(100, 200, 300)
    Attribute
    constructor: Returns the string "Function"
    length: Returns the number of formal parameters of the function.
    Method
    toString: Returns the string "[function Function]"
    Sample Code:
    var func = function(a, b, c) {}
    
    console.log('Function' === func.constructor)
    console.log(3 === func.length)
    console.log('[function Function]' === func.toString())

    array

    Syntax
    The array supports the following definition methods:
    var a = [] // Generates a new empty array
    
    a = [1, '2', {}, function() {}] // Generates a new non-empty array, the elements of which can be of any type.
    Attribute
    constructor: Returns the string "Array"
    length
    Method
    toString
    concat
    join
    pop
    push
    reverse
    shift
    slice
    sort
    splice
    unshift
    indexOf
    lastIndexOf
    every
    some
    forEach
    map
    filter
    reduce
    reduceRight
    Note:
    For specific usage of the above methods, please refer to the ES5 standard.

    date

    Syntax
    To generate a date object, the getDate function must be used, returning an object of the current time.
    getDate()
    getDate(milliseconds)
    getDate(datestring)
    getDate(year, month[, date[, hours[, minutes[, seconds[, milliseconds]]]]])
    Parameter
    milliseconds: The number of milliseconds calculated from 00:00:00 UTC on January 1, 1970.
    datestring: A date string in the format: "month day, year hours:minutes:seconds".
    Attribute
    constructor: Returns the string "Date".
    Method
    toString
    toDateString
    toTimeString
    toLocaleString
    toLocaleDateString
    toLocaleTimeString
    valueOf
    getTime
    getFullYear
    getUTCFullYear
    getMonth
    getUTCMonth
    getDate
    getUTCDate
    getDay
    getUTCDay
    getHours
    getUTCHours
    getMinutes
    getUTCMinutes
    getSeconds
    getUTCSeconds
    getMilliseconds
    getUTCMilliseconds
    getTimezoneOffset
    setTime
    setMilliseconds
    setUTCMilliseconds
    setSeconds
    setUTCSeconds
    setMinutes
    setUTCMinutes
    setHours
    setUTCHours
    setDate
    setUTCDate
    setMonth
    setUTCMonth
    setFullYear
    setUTCFullYear
    toUTCString
    toISOString
    toJSON

    regexp

    Syntax
    To generate a regexp object, the getRegExp function must be utilized.
    getRegExp(pattern[, flags])
    Parameter:
    pattern: The content of the regular expression.
    flags: Modifiers
    flagg: global
    flagi: ignoreCase
    flagm: multiline
    Sample Code:
    var a = getRegExp('x', 'img')
    console.log('x' === a.source)
    console.log(true === a.global)
    console.log(true === a.ignoreCase)
    console.log(true === a.multiline)
    Attribute
    constructor: Returns the string "RegExp".
    source
    global
    ignoreCase
    multiline
    lastIndex
    Note:
    For the specific meanings of attributes other than the constructor, please refer to the ES5 standard.
    Method
    exec
    test
    toString
    Note:
    For specific usage of the above methods, please refer to the ES5 standard.

    Data type determination

    construct attribute

    The determination of data types can be accomplished using the constructor attribute.
    Sample Code:
    var number = 10
    console.log('Number' === number.constructor)
    
    var string = 'str'
    console.log('String' === string.constructor)
    
    var boolean = true
    console.log('Boolean' === boolean.constructor)
    
    var object = {}
    console.log('Object' === object.constructor)
    
    var func = function() {}
    console.log('Function' === func.constructor)
    
    var array = []
    console.log('Array' === array.constructor)
    
    var date = getDate()
    console.log('Date' === date.constructor)
    
    var regexp = getRegExp()
    console.log('RegExp' === regexp.constructor)

    typeof

    The typeof can also be used to distinguish certain data types.
    Sample Code:
    var number = 10
    var boolean = true
    var object = {}
    var func = function() {}
    var array = []
    var date = getDate()
    var regexp = getRegExp()
    
    console.log('number' === typeof number)
    console.log('boolean' === typeof boolean)
    console.log('object' === typeof object)
    console.log('function' === typeof func)
    console.log('object' === typeof array)
    console.log('object' === typeof date)
    console.log('object' === typeof regexp)
    
    console.log('undefined' === typeof undefined)
    console.log('object' === typeof null)

    Basic Class Library

    console

    The console.log method is utilized for displaying information in the console window. It can accept multiple parameters, concatenating their results for output.

    Math

    Attribute
    E
    LN10
    LN2
    LOG2E
    LOG10E
    PI
    SQRT1_2
    SQRT2
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.
    Method
    abs
    acos
    asin
    atan
    atan2
    ceil
    cos
    exp
    floor
    log
    max
    min
    pow
    random
    round
    sin
    sqrt
    tan
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.

    JSON

    Method
    stringify(object): Transforms the object into a JSON string, returning the resultant string.
    parse(string): Converts a JSON string into an object, returning the resultant object.
    Sample Code:
    console.log(undefined === JSON.stringify())
    console.log(undefined === JSON.stringify(undefined))
    console.log('null' === JSON.stringify(null))
    
    console.log('111' === JSON.stringify(111))
    console.log('"111"' === JSON.stringify('111'))
    console.log('true' === JSON.stringify(true))
    console.log(undefined === JSON.stringify(function() {}))
    
    console.log(undefined === JSON.parse(JSON.stringify()))
    console.log(undefined === JSON.parse(JSON.stringify(undefined)))
    console.log(null === JSON.parse(JSON.stringify(null)))
    
    console.log(111 === JSON.parse(JSON.stringify(111)))
    console.log('111' === JSON.parse(JSON.stringify('111')))
    console.log(true === JSON.parse(JSON.stringify(true)))
    
    console.log(undefined === JSON.parse(JSON.stringify(function() {})))

    Number

    Attribute
    MAX_VALUE
    MIN_VALUE
    NEGATIVE_INFINITY
    POSITIVE_INFINITY
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.

    Date

    Attribute
    parse
    UTC
    now
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.

    Global

    Attribute
    NaN
    Infinity
    undefined
    Note:
    For specific usage of the above attributes, please refer to the ES5 standard.
    Method
    parseInt
    parseFloat
    isNaN
    isFinite
    decodeURI
    decodeURIComponent
    encodeURI
    encodeURIComponent
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support