Book Image

JavaScript Complete Grandmaster 2023 [Video]

By : SkillZone .
Book Image

JavaScript Complete Grandmaster 2023 [Video]

By: SkillZone .

Overview of this book

JavaScript is the #1 scripting language of the web, where a lot of the dynamic and styled content is handled by JavaScript in the background. But before using this language to create dynamic websites, you need to have a firm grasp of how it works behind the scenes. You will learn “why” things work and not just “how”. Understanding the fundamentals of JavaScript is important as it will allow you to write more complicated code. And trust me, every programming encounters bugs, and without understanding the fundamentals, you will be totally lost. By the end of this course, you will be able to “speak” JavaScript by gaining an understanding of how the browser uses it; what variables, objects, and functions are; what different data types there are; and how to manipulate content on a website. We will dig deeper and create our own dialog methods from scratch. You will learn about the arrow syntax, Math.random() function, looping through objects and arrays, and working with dates. We will look at prototypes, JS Engines, the Execution Stack, and a whole bunch more! Through practical examples, this course helps you understand JavaScript piece by piece. And we will use the latest and best features of JavaScript along the way so you can stay ahead of the pack. All the resources for this course are available at https://github.com/PacktPublishing/Complete-JavaScript-Course
Table of Contents (16 chapters)
Chapter 10
Objects
Content Locked
Section 9
Creating Objects - 1. Object Literal
An object literal is a list of name-value pairs (each pair is separated by a comma) wrapped in curly braces. Object literals encapsulate your data and enclose it in a tidy package. Why is this useful? Well, it reduces the need to use global variables which can cause problems when combining code. Object literals are also the easiest way to create an object in JavaScript.