1. Data Types
- String // "Any text"
- Number // 1345
- Boolean // true or false
- Null //null
- Undefined // undefined
- Symbol //Symbol('something')
- Object // { key : 'value' }
- Array // [23,"text",true]
- Function // function name(){}
2. Basic Vocabulary
Variable
In the following example, A named reference to a value is a variable.
Example
var a = 10 + "2";
Operator
Operators are reserved-words that perform action on values and variables.
Example : + - = * in === typeof !=..
Keyword/reserved word
Any word that is part of the vocabulary of the programming language is called a keyword it is also known as a reserved word
Example: var = + if for ...
Expression
A reference, value, or a group of reference and value combined with the operator, which results in a single value.
Statement
A group of words, numbers, and operators that do a task is a statement.
3.Object
An object is a data type in javascript that is used to store a combination of data in a simple key-value pair.
Example:
let user = {
name: 'HTML Space Code',
address: 'Kathmandu',
yearOfBirth: 2019,
doSomething: function () {
//do something
}
}
Key
name, address, yearOfBirth, and doSomething are the keys in the user object.
let user = {
name: 'HTML Space Code',
address: 'Kathmandu',
yearOfBirth: 2019,
doSomething: function () {
//do something
}
}
Value
HTML space code, Kathmandu, 2019, and function are the values of respective keys in the user object.
let user = {
name: 'HTML Space Code',
address: 'Kathmandu',
yearOfBirth: 2019,
doSomething: function () {
//do something
}
}
Method
If a key has a function as a value, it is called a method.
doSomething: function () {
//do something
}
0 Comments
If you have any question please ask?