Posts

Note 4 : Object

Image
Previously we have seen all types of primitive types. now let see reference types. Object: It is the collection of highly related variables or can say a group of highly related variables is known as an object. here is the basic syntax of an object. If we want to access any property of an object we can use DOT. like here for example, if we want to access name we can simply write "person.name". another way is to access any property of an object is using Bracket Notation. like person["name"]. Something Advance about the Objects: so we can encapsulate highly related key-value pairs together in an object. we can declare an object with object literal syntax. and inside them, we can add one or more key-value pairs. in the object, we store highly related properties. in the object, we have key-value pairs. and in the value, we can store anything we want so I can say value can be anything. it can be a number, a string, a boolean or it can be null, it can be undefined, it can ...

Note 3 : Variable , Constant , Primitive Type and Dynamic Types.

Image
Variable : It is one of the most fundamental core concepts in any programing language. We use variables to store data temporarily.  so we store data somewhere and give that memory location a name and with the name, we read the data and use the location in the future. so before ES6, we use the var keyword to declare any variable. but now going forward from ES6 the best practice is to use let or const keyword.   There are some rules while declaring a variable. Can't be reserved keyword. Should be meaningful. can't start with a number. can't contain any space or any other special symbol or hyphen(-). There are case sensitive.(user and USER are different). Constant :  There is a certain scenario when we don't want to change the value of any variable because it can create all kind of bugs which we don't want in our project. or in a simple way, I can say if I want a variable whose value I want to change the future anywhere so then I can use const keyword. The best example...