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 7
Variables
Content Locked
Section 5
VAR - the Old Way to Declare a Variable
Creating variables consists of declaring that variable, initializing it, and then finally assigning a value to it. But before we move on to the preferred ways to declare variables (LET and CONST), it is good for you to understand the old-school way of doing so with the VAR keyword. A VAR has function scope (VAR declares a variable that's visible throughout the function) even though it looks like it has block scope. We will get into more detail on scope later.