loading...
Cover image for Getting Started: Easy Way to Objects in JavaScript

Getting Started: Easy Way to Objects in JavaScript

seyifunmitanjs profile image Oluwaseyifunmi ・1 min read

Almost Everything in JavaScript are objects, ranging from functions to object itself etc, except the primitive values.
Even some primitive values when called with the ‘new’ keyword will still return an object.

Math, RegExp, Date, function are all objects,
with the new keyword string, number, Boolean will also return an object.

In JavaScript objects controls almost everything, objects is the main route, the emperor of JavaScript, if you understand how objects works in and out, there’s chances you will understand how JavaScript works.

what are primitive values ?
Primitive values are values with no property and methods, In JavaScript Primitive values are not objects, they are immutable and hard coded value, which can’t be change.

Example of primitive values in JavaScript are string, numbers, Boolean, null, and undefined.

Let name = ‘John Doe’

Primitive data types
Are data that has a primitive value.

What are objects
Let take a glance through variables in JavaScript,
const pie = 3.14

JavaScript variable can only contain a single value, in this example the only value is 3.14, Objects are also variables.

Objects are variables that can contain more than one value, basically a collection of named values

Read More on howtothese.xyz

Posted on by:

seyifunmitanjs profile

Oluwaseyifunmi

@seyifunmitanjs

Web-dev & JAM-STACK Passionate about impacting check my blog http://howtothese.xyz #sveltejs

Discussion

markdown guide