Compatibility
What is currently supported What is not supported yet |
njs is created in compliance with ECMAScript 5.1 (strict mode) with some ECMAScript 6 and later extensions. The compliance is still evolving.
What is currently supported
- Boolean values, numbers, strings, objects, arrays, functions, and regular expressions
- ES5.1 operators, ES7 exponentiation operators
-
ES5.1 statements:
var
,if
,else
,switch
,for
,for in
,while
,do while
,break
,continue
,return
,try
,catch
,throw
,finally
-
ES6
Number
andMath
properties and methods -
String
methods:-
ES5.1:
fromCharCode
,concat
,slice
,substring
,substr
,charAt
,indexOf
,lastIndexOf
,toLowerCase
,toUpperCase
,trim
,search
,match
,split
,replace
-
ES6:
fromCodePoint
,codePointAt
,includes
,startsWith
,endsWith
,repeat
-
ES8:
padStart
,padEnd
-
non-standard:
bytesFrom
(0.2.3)fromUTF8
,toUTF8
,fromBytes
,toBytes
-
ES5.1:
-
Object
methods: -
Array
methods:-
ES5.1:
isArray
,slice
,splice
,push
,pop
,unshift
,shift
,reverse
,sort
,join
,concat
,indexOf
,lastIndexOf
,forEach
,some
,every
,filter
,map
,reduce
,reduceRight
-
ES6:
of
,fill
,find
,findIndex
-
ES7:
includes
-
ES5.1:
-
ES5.1
Function
methods:call
,apply
,bind
-
ES5.1
RegExp
methods:test
,exec
-
ES5.1
Date
methods -
ES5.1
JSON
object -
ES5.1
arguments
object (0.2.5) - ES6 rest parameters syntax (without destructuring support) (0.2.7)
-
ES5.1 global functions:
isFinite
,isNaN
,parseFloat
,parseInt
,decodeURI
,decodeURIComponent
,encodeURI
,encodeURIComponent
-
Error
objects:Error
,EvalError
,InternalError
,RangeError
,ReferenceError
,SyntaxError
,TypeError
,URIError
-
setTimeout
andclearTimeout
functions (0.2.0) -
Node.js style
File system
methods:fs.readFileSync
,fs.appendFileSync
,fs.writeFileSync
-
Node.js style
Crypto
methods (0.2.0):crypto.createHash
,crypto.createHmac
What is not supported yet
-
ES6
let
andconst
declarations - labels
-
eval
function -
new Function()
constructor -
setInterval
,setImmediate
functions