object JSON extends Object
The JSON object contains methods for converting values to JavaScript Object Notation (JSON) and for converting JSON to values.
MDN
- Alphabetic
- By Inheritance
- JSON
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: scala.Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: scala.Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hasOwnProperty(v: String): Boolean
Tests whether this object has the specified property as a direct property.
Tests whether this object has the specified property as a direct property.
Unlike js.Object.hasProperty, this method does not check down the object's prototype chain.
MDN
- Definition Classes
- Object
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isPrototypeOf(v: Object): Boolean
Tests whether this object is in the prototype chain of another object.
Tests whether this object is in the prototype chain of another object.
- Definition Classes
- Object
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parse(text: String, reviver: Function2[Any, Any, Any] = js.native): Dynamic
Parse a string as JSON, optionally transforming the value produced by parsing.
Parse a string as JSON, optionally transforming the value produced by parsing.
- text
The string to parse as JSON. See the JSON object for a description of JSON syntax.
- reviver
If a function, prescribes how the value originally produced by parsing is transformed, before being returned. MDN
- def propertyIsEnumerable(v: String): Boolean
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.
Tests whether the specified property in an object can be enumerated by a call to js.Object.properties, with the exception of properties inherited through the prototype chain.
If the object does not have the specified property, this method returns false.
MDN
- Definition Classes
- Object
- def stringify(value: Any, replacer: Array[Any], space: |[Int, String]): String
- def stringify(value: Any, replacer: Array[Any]): String
- def stringify(value: Any, replacer: Function2[String, Any, Any] = js.native, space: |[Int, String] = js.native): String
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
Convert a value to JSON, optionally replacing values if a replacer function is specified, or optionally including only the specified properties if a replacer array is specified.
- If the value has a toJSON() method, it is responsible to define what data will be serialized.
- Boolean, Number, and String objects are converted to the corresponding primitive values during stringification, in accord with the traditional conversion semantics.
- undefined, Functions, and Symbols are not valid JSON values. If any such values are encountered during conversion they are either omitted (when found in an Object) or changed to null (when found in an Array). In Scala.js it is undefined behavior to directly pass any of these values to stringify.
- All Symbol-keyed properties will be completely ignored, even when using the replacer function.
- The instances of Date implement the Date#toJSON()* function by returning a string (the same as Date#toISOString). Thus, they are treated as strings.
- The numbers Infinity and NaN, as well as the value null, are all considered null.
- All the other Object instances (including Map, Set, WeakMap, and WeakSet) will have only their enumerable properties serialized.
- value
The value to convert to a JSON string.
- replacer
If a function, transforms values and properties encountered while stringifying; if an array, specifies the set of properties included in objects in the final string.
- space
A String or Int that's used to insert white space into the output JSON string for readability purposes. If this is an Int, it indicates the number of space characters to use as white space; this number is capped at 10; values less than 1 indicate that no space should be used. If this is a String, the string (or the first 10 characters of the string, if it's longer than that) is used as white space. If this parameter is not provided (or is null), no white space is used. MDN
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toLocaleString(): String
- Definition Classes
- Object
- def toString(): String
- Definition Classes
- AnyRef → Any
- def valueOf(): scala.Any
- Definition Classes
- Object
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()