Supertype of all JavaScript values.
Arrays are list-like objects whose prototype has methods to perform traversal and mutation operations.
Equivalent of scm.
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.
Operations on JavaScript numbers.
Operations on JavaScript strings.
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.
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.
Equivalent of scm.
Wrapper to use a js.
Provides implicit conversions from Scala values to JavaScript values.
Factory for js.Array objects.
Factory for js.Date objects.
Factory for Dictionary instances.
Factory for dynamically typed JavaScript values.
Provides implicit conversions and operations to write in JavaScript style with js.Dynamic.
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 top-level Object
JavaScript object.
Methods related to URIs, provided by ECMAScript 5.
$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:
Evaluates JavaScript code and returns the result.
Evaluates JavaScript code and returns the result.
Tests whether the given value is undefined.
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 }
Non-Standard Non-standard, but in general well supported methods to schedule asynchronous exeuction.
Returns the type of x
as identified by typeof x
in JavaScript.
ECMAScript 6 The typdearray package provides facade types for JavaScript ArrayBuffer, TypeArrays and DataView.
The undefined value.
The undefined value.
Types, methods and values 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.
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 functions to JavaScript functions 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.
There are no explicit definitions for JavaScript primitive types, as one could expect, because the corresponding Scala types stand in their stead:
js.UndefOr gives a scala.Option-like interface where the JavaScript value
undefined
takes the role ofNone
.