JavaScript Object VS Primitive

preview_player
Показать описание
We already know that, in JavaScript we have five primitive types i.e. Number, String, Boolean, undefined and null. Everything else like arrays, functions, objects etc. are all objects.

In this lecture, lets understand the basic difference between primitive type values and objects in JavaScript.
Рекомендации по теме
Комментарии
Автор

Doesn't JS have 2 more primitive data types : bigint and symbol?

Coming from my background knowledge in Python, your video helped me to understand the basic concepts of JS. Especially, your memory picture visually added a bit more.
Btw, Python also has mutable objects such as List, Set, and Dictionary. It works pretty same as you mentioned :)

jathebest
Автор

We say that an object has properties. And each property is essentially a key-value pair. Does a key-value pair follow the same concept as the variable concept?

Variable concept: the name of the variable is the label of the box and the value of the variable is stored inside of that box. That value is stored somewhere in the computer's memory and by using the name of the variable we can read the value in the future and change it if we want.

petarkarchev
Автор

In 08:56,two object variables point to one object address only, but in 15:24, two object variables point to two different object addresses。 Why? In 15:24, the content in address 0x12341 is same as the content in address 0x12345., so, why they are in different cell?

leeeric
Автор

var x = [1];
var y = x;

x = [];
console.log(x, y);
o/p => [], [1] Plz elaborate why this is happen?

krishangoel