Super-type of all JavaScript values.
Arrays are list-like objects whose prototype has methods to perform traversal and mutation operations.
Equivalent of scm.
The type of JavaScript booleans, which is scala.Boolean.
Creates a JavaScript Date instance that represents a single moment in time.
Dictionary "view" of a JavaScript value.
Dynamically typed JavaScript value.
An instance representing an error that occurs regarding the global function eval()
The Function constructor creates a new Function object.
Marker trait for top-level objects representing the JS global scope.
Base class for top-level, entry point main objects.
Discouraged native JavaScript Array methods.
The type of JavaScript numbers, which is scala.Double.
Base class of all JavaScript objects.
An instance representing an error that occurs when a numeric variable or parameter is outside of its valid range.
Represents an error when a non-existent variable is referenced.
The RegExp constructor creates a regular expression object for matching text with a pattern.
The type of JavaScript strings, which is java.lang.String.
Represents an error when trying to interpret syntactically invalid code.
A JavaScript function where this
is considered as a first parameter.
Represents an error when a value is not of the expected type.
Represents an error when a malformed URI is encountered.
Value of type A or the JS undefined value.
The type of the JavaScript undefined value, which is scala.Unit.
Equivalent of scm.
Wrapper to use a js.
Provides implicit conversions from Scala values to JavaScript values.
Factory for js.Array objects.
The top-level Boolean
JavaScript object.
Factory for js.Date objects.
Factory for Dictionary instances.
Factory for dynamically typed JavaScript values.
The constant Positive Infinity.
A collection of decorators that allow converting Scala types to corresponding JS facade types
The JSON object contains methods for converting values to JavaScript Object Notation (JSON) and for converting JSON to values.
Math is a built-in object that has properties and methods for mathematical constants and functions.
The constant Not-a-Number.
The top-level Number
JavaScript object.
The top-level Object
JavaScript object.
The top-level String
JavaScript object.
$factoryInfo
Invokes any available debugging functionality.
Invokes any available debugging functionality. If no debugging functionality is available, this statement has no effect.
MDN
Browser support:
Decodes a Uniform Resource Identifier (URI).
Decodes a Uniform Resource Identifier (URI).
Decodes a Uniform Resource Identifier (URI) component.
Decodes a Uniform Resource Identifier (URI) component.
Encodes a Uniform Resource Identifier (URI).
Encodes a Uniform Resource Identifier (URI).
Encodes a Uniform Resource Identifier (URI) component.
Encodes a Uniform Resource Identifier (URI) component.
Evaluates JavaScript code and returns the result.
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
Tests whether the given value is a finite number.
Tests whether the given value is Not-a-Number.
Tests whether this object is in the prototype chain of another object.
Tests whether this object is in the prototype chain of another object.
Tests whether the given value is undefined.
Denotes a method body as native JavaScript.
Denotes a method body as native JavaScript. For use in facade types:
class MyJSClass extends js.Object { def myMethod(x: String): Int = js.native }
Parses a string as a floating point number.
Parses a string as an integer with auto-detected radix.
Parses a string as an integer with a given radix.
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
Returns the type of x
as identified by typeof x
in JavaScript.
The typdearray package provides facade types for JavaScript ArrayBuffer, TypeArrays and DataView.
The undefined value.
Contains primitive types for interoperability with JavaScript libraries. This package is only relevant to the Scala.js compiler, and should not be referenced by any project compiled to the JVM.
All the values and methods in this package object are representatives of standard variables and functions available in the top-level scope, as standardized in ECMAScript 5.1.
Guide
General documentation on Scala.js is available at http://www.scala-js.org/doc/.
Overview
The trait js.Any is the super type of all JavaScript values.
All class, trait and object definitions that inherit, directly or indirectly, from js.Any do not have actual implementations in Scala. They are only the manifestation of static types representing libraries written directly in JavaScript. It is not possible to implement yourself a subclass of js.Any: all the method definitions will be ignored when compiling to JavaScript.
Implicit conversions to and from standard Scala types to their equivalent in JavaScript are provided. For example, from Scala arrays to JavaScript arrays and back.
The most important subclasses of js.Any are:
this
as an explicit parametersThe trait js.Dynamic is a special subtrait of js.Any. It can represent any JavaScript value in a dynamically-typed way. It is possible to call any method and read and write any field of a value of type js.Dynamic.
The package scala.scalajs.js.prim gives definitions for the four primitive types of JavaScript as subtraits of js.Any, but generally it is preferable to use the corresponding Scala type.
js.UndefOr gives a scala.Option-like interface where the JavaScript value
undefined
takes the role ofNone
.