神岛 API 文档 - ArenaPro版
    Preparing search index...

    一个内置的 JSON 对象,包含用于解析和序列化 JSON 的方法。

    An intrinsic object that provides methods to parse and serialize JSON (JavaScript Object Notation).

    interface JSON {
        "[toStringTag]": string;
        parse(
            text: string,
            reviver?: (this: any, key: string, value: any) => any,
        ): any;
        parse(
            text: string,
            reviver?: (this: any, key: string, value: any) => any,
        ): any;
        stringify(
            value: any,
            replacer?: (this: any, key: string, value: any) => any,
            space?: string | number,
        ): string;
        stringify(
            value: any,
            replacer?: (string | number)[],
            space?: string | number,
        ): string;
        stringify(
            value: any,
            replacer?: (this: any, key: string, value: any) => any,
            space?: string | number,
        ): string;
        stringify(
            value: any,
            replacer?: (string | number)[],
            space?: string | number,
        ): string;
    }
    Index

    Properties

    Methods

    Properties

    "[toStringTag]": string

    一个字符串值,用于创建对象的默认字符串描述。由内置方法 Object.prototype.toString 调用。

    A String value that is used in the creation of the default string description of an object. Called by the built-in method Object.prototype.toString.

    Methods

    • Converts a JavaScript Object Notation (JSON) string into an object.

      Parameters

      • text: string

        A valid JSON string.

      • Optionalreviver: (this: any, key: string, value: any) => any

        A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.

      Returns any

    • Parameters

      • text: string
      • Optionalreviver: (this: any, key: string, value: any) => any

      Returns any

      将一个 JSON 字符串转换为一个对象。

      Converts a JavaScript Object Notation (JSON) string into an object.

      一个有效的 JSON 字符串。

      A valid JSON string.

      一个转换结果的函数。此函数会为对象的每个成员调用。如果成员包含嵌套对象,则在父对象之前转换嵌套对象。

      A function that transforms the results. This function is called for each member of the object. If a member contains nested objects, the nested objects are transformed before the parent object is.

    • Converts a JavaScript value to a JavaScript Object Notation (JSON) string.

      Parameters

      • value: any

        A JavaScript value, usually an object or array, to be converted.

      • Optionalreplacer: (this: any, key: string, value: any) => any

        A function that transforms the results.

      • Optionalspace: string | number

        Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.

      Returns string

    • Converts a JavaScript value to a JavaScript Object Notation (JSON) string.

      Parameters

      • value: any

        A JavaScript value, usually an object or array, to be converted.

      • Optionalreplacer: (string | number)[]

        An array of strings and numbers that acts as an approved list for selecting the object properties that will be stringified.

      • Optionalspace: string | number

        Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.

      Returns string

    • Parameters

      • value: any
      • Optionalreplacer: (this: any, key: string, value: any) => any
      • Optionalspace: string | number

      Returns string

      将一个 JavaScript 值转换为一个 JSON 字符串。

      Converts a JavaScript value to a JavaScript Object Notation (JSON) string.

      一个 JavaScript 值,通常是一个对象或数组,需要被转换。

      A JavaScript value, usually an object or array, to be converted.

      一个转换结果的函数。

      A function that transforms the results.

      向返回值 JSON 文本添加缩进、空白和换行符,使其更易于阅读。

      Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.

    • Parameters

      • value: any
      • Optionalreplacer: (string | number)[]
      • Optionalspace: string | number

      Returns string

      将一个 JavaScript 值转换为一个 JSON 字符串。

      Converts a JavaScript value to a JavaScript Object Notation (JSON) string.

      一个 JavaScript 值,通常是一个对象或数组,需要被转换。

      A JavaScript value, usually an object or array, to be converted.

      一个由字符串和数字组成的数组,用作白名单,用于选择将被字符串化的对象属性。

      An array of strings and numbers that acts as a approved list for selecting the object properties that will be stringified.

      向返回值 JSON 文本添加缩进、空白和换行符,使其更易于阅读。

      Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.