-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patha1Example.js
More file actions
32 lines (24 loc) · 751 Bytes
/
Copy patha1Example.js
File metadata and controls
32 lines (24 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Variable
let variable = 1
const pi = 3.1416
console.log('The Variable and the const is ', variable, pi);
// Array
let arr = [1, 2, 3, 4, '4343']
console.log('The 1st version of the array is', arr)
arr.push('ABC');
console.log('The Array after pushing a new element', arr)
arr.pop();
console.log('The Array after poping the last element', arr)
console.log('The Array after Spreading', ...arr)
let [first, second, third] = arr;
console.log('After Array Destructuring', first, second, third)
// Object
const student = {
name: "Ghost",
age: 23,
semester: 12,
}
const { name, age } = student;
console.log('After Destructuring the Object', name, age)
// Template literals
console.log(`Hi i am ${name} and I am ${age} years old`)