Object Type =========== number ==> numerals ==> 121, 1.02 etc. string ==> '' or "" or `` Boolean ==> true or false undefined null arrays ==> [] or new Array() Ex: a = [1,2,3,4,5,6] log(a) ==> [1,2,3,4,5,6] =========================== Form Registration: ================== Name Mail Mobile Password application =====================> database API Name: ravi Mail: ravivraoinfs@gmail.com Mobile: 8977029779 Password: Ravi123 request: google.com response: after the registration we can allow for login at the time of login: username/mail/mobile:admin123 password: admin123 application =========> database API/Sql ==> Object type is a collection datatype is the collection of elements which can be defined with key and value pair format. Syntax for key value pair: key-name : corresponding-value ================================================== Creation of object type: ======================== ==> four ways: 1) Using object literal: ======================== Syntax: let/var/const object-name = {key1:val1,key2:val2,key3:val3,...}; const book = {title:'To Kill a Mockingbird', author:"Harper Lee", yearOfPublished:1960, genres : ['Fiction','Drama'], availableCopies:0, isAvailable:function(){ return this.availableCopies > 0; }, borrow:function(){ if(this.isAvailable()){ this.availableCopies--; console.log("The Number of books remianing are = ",this.availableCopies); } else{ console.log("The Book is not available."); } } }; console.log(typeof book); console.log(book); console.log(book.title); console.log(book.author); console.log(book.yearOfPublished); console.log(book.genres); console.log(book.availableCopies); console.log(book.isAvailable()); book.borrow(); ========================================================= 2) using Object() constructor: ============================== Syntax: let/var/const object-name = new Object(); Syntax for adding properties into an object: object-name.property-name = value; const car = new Object(); console.log(typeof car); console.log(car); // adding properties into an object car.make = "Toyota"; car.model = "Corolla"; car.year = 2023; console.log(car); =============================================== 3) Using class: =============== class Car{ constructor(make,model,year,color){ this.make = make; this.model = model; this.year = year; this.color = color; } describe(){ return `${this.year} ${this.color} ${this.make} ${this.model}`; } startEngine(){ return `${this.describe()} is starting...`; } stopEngine(){ return `${this.describe()} is stopping...`; } } const car1 = new Car("Tesla","Model3",2024,"red"); console.log(car1.describe()); console.log(car1.startEngine()); console.log(car1.stopEngine());