w3resource

JavaScript: Core Objects

JavaScript : Core Objects

List of JavaScript core objects

Name of the object Version
Array Object Implemented in JavaScript 1.1
Boolean Object Implemented in JavaScript 1.1
Date Object Implemented in JavaScript 1.0
Function Object Implemented in JavaScript 1.1
Java Implemented in JavaScript 1.2
JavaArray Implemented in JavaScript 1.1
JavaClass Implemented in JavaScript 1.1
Java Implemented in JavaScript 1.1
JavaPackage Implemented in JavaScript 1.1
Math Object Implemented in JavaScript 1.0
netscape Implemented in JavaScript 1.1
Number Object Implemented in JavaScript 1.1
Object Implemented in JavaScript 1.0
Packages Implemented in JavaScript 1.1
RegExp Object Implemented in JavaScript 1.2
String Object Implemented in JavaScript 1.0
sun Implemented in JavaScript 1.1

Previous: JavaScript Object
Next: Javascript Array Objects - Properties and Methods

Test your Programming skills with w3resource's quiz.



JavaScript: Tips of the Day

Sort Number Arrays

JavaScript arrays come with a built-in sort method. This sort method converts the array elements into strings and performs a lexicographical sort on it by default. This can cause issues when sorting number arrays. Hence here is a simple solution to overcome this problem.

[0,10,4,9,123,54,1].sort((a,b) => a-b);
>>> [0, 1, 4, 9, 10, 54, 123]

You are providing a function to compare two elements in the number array to the sort method. This function helps us the receive the correct output.

Ref: https://bit.ly/3adlwNy