javascript #1 primitives vs objects

Published: 21 January 2018
on channel: Sudhir Kenguva
399
13

JavaScript has many types of values (like numbers, strings, arrays etc.) that we see in any other programming language.

Which can be Primitive Values (Primitives) Or Objects
-------------------------------------------------------------------------------------
Primitive values include

Number type – 1 , 2.03, -8.09
Boolean type – true, false
String type – ‘abc’, “xyz”
Special type – null, undefined

-------------------------------------------------------------------------------------

Objects include

Literals / Plain objects – { name: ‘Sudhir’, country: ‘India’ }
Arrays– [‘JavaScript’, ‘C’, ‘C++’, ‘Java’]
Regex - [^A-Za-z0-9]

----------------------------------------------------------------------------------------
Primitives Vs Objects

There are mainly 2 differences :
Comparison
Primitives always compared by value whereas objects are always compared by reference
Mutability
Objects are mutable whereas primitives are immutable.


On this page of the site you can watch the video online javascript #1 primitives vs objects with a duration of hours minute second in good quality, which was uploaded by the user Sudhir Kenguva 21 January 2018, share the link with friends and acquaintances, this video has already been watched 399 times on youtube and it was liked by 13 viewers. Enjoy your viewing!