Category: JavaScript Objects

  • JavaScript Boolean

    JavaScript Boolean is an object that represents value in two states: true or false. You can create the JavaScript Boolean object by Boolean() constructor as given below. The default value of JavaScript Boolean object is false. JavaScript Boolean Example JavaScript Boolean Properties Property Description constructor returns the reference of Boolean function that created Boolean object. prototype enables you to add…

  • JavaScript Number Object

    The JavaScript number object enables you to represent a numeric value. It may be integer or floating-point. JavaScript number object follows IEEE standard to represent the floating-point numbers. By the help of Number() constructor, you can create number object in JavaScript. For example: If value can’t be converted to number, it returns NaN(Not a Number) that can be…

  • JavaScript Math

    The JavaScript math object provides several constants and methods to perform mathematical operation. Unlike date object, it doesn’t have constructors. JavaScript Math Methods Let’s see the list of JavaScript Math methods with description. Methods Description abs() It returns the absolute value of the given number. acos() It returns the arccosine of the given number in radians. asin()…

  • JavaScript Date Object

    The JavaScript date object can be used to get year, month and day. You can display a timer on the webpage by the help of JavaScript date object. You can use different Date constructors to create date object. It provides methods to get and set day, month, year, hour, minute and seconds. Constructor You can use 4…

  • JavaScript Array

    JavaScript array is an object that represents a collection of similar type of elements. There are 3 ways to construct array in JavaScript 1) JavaScript array literal The syntax of creating array using array literal is given below: As you can see, values are contained inside [ ] and separated by , (comma). Let’s see the…

  • JavaScript Objects

    A javaScript object is an entity having state and behavior (properties and method). For example: car, pen, bike, chair, glass, keyboard, monitor etc. JavaScript is an object-based language. Everything is an object in JavaScript. JavaScript is template based not class based. Here, we don’t create class to get the object. But, we direct create objects.…