Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Document 0.11.2 change

Several operators can be applied to objects of any type.

Table of Contents


Info
titleEngine Compatibility

In the node pico engine, the The target types for the as() function and the results returned from the typeof() function are these values:

  • "Array"

  • "Boolean"

  • "Map"

  • "Null"

  • "Number"

  • "RegExp"

  • "String"


The following coercions are valid:

  • Strings can be coerced to numbers (0 on failurenull if not parsable) and regular expressions.
  • Numbers can be coerced to strings.
  • Regular expressions can be coerced to strings.
  • Any expression can be coerced to Boolean.
  • null and false can be coerced to 0, andtrue can be coerced to 1

An error is thrown for other attempted coercions, unless the value being coerced by as() is already of the target type.

...