WEEK 1O Flashcards
The JavaScript ___ are meaningful way to deliver message. It is used to add information about the code, warnings or suggestions so that end user can easily interpret the code.
comments
The JavaScript comment is ___ by the JavaScript engine i.e. embedded in the browser.
ignored
Advantages of JavaScript comments
- To make code easy to understand
- To avoid the unnecessary code, it can also be used to avoid the code being executed.
Two types of comments in JavaScript.
- Single-line Comment
- Multi-line Comment
It is represented by double forward slashes (//). It
can be used before and after the statement.
JavaScript Single line Comment -
It can be used to add single as well as multi line
comments. So, it is more convenient. It is represented by forward slash with asterisk then asterisk with forward slash.
JavaScript Multi line Comment
A JavaScript ___ is simply a name of storage location.
variable
There are two types of variables in JavaScript:
local variable and global variable
A JavaScript ___ is accessible from any function. A variable i.e. declared outside the function or declared with window object is known as global variable.
global variable
There are some rules while declaring a JavaScript variable (also known as identifiers)
- Name must start with a letter (a to z or A to Z), underscore (_ ), or dollar( $ ) sign.
- After first letter we can use digits (0 to 9), for example value1.
- JavaScript variables are case sensitive, for example x and X are different variables.
A JavaScript ___ is declared inside block or function. It is accessible within the function or block only.
local variable
JavaScript provides different data types to hold different
types of values.
Javascript Data Types
JavaScript is a ___, means you don’t need to specify type of the variable because it is dynamically used by JavaScript engine.
dynamic type language
There are two types of data types in JavaScript:
- Primitive data type
- Non-primitive (reference) data type
Five types of primitive data types in JavaScript:
- String
- Number
- Boolean
- Undefined
- Null