-
Notifications
You must be signed in to change notification settings - Fork 0
/
2.js
48 lines (45 loc) · 814 Bytes
/
2.js
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//CREATING VARIABLES
let age=10;
const name="Alfred";
console.log(age);
//REASSIGNING(CHANGING)VAULES
age=15;
console.log(age);
console.log(name);
//NAMING CONVENTIONS
//FIRSTNAME,firstname,firstName,first_name,Firstname
//DATATYPES
//STRINGS
let str='I am boy'
str=" i'm a coder"
//NUMBERS
let num=20;
num=-20;
num=20.237;
//BOOLEAN
let ismale=true;
let isfemale=false;
//NULL
let num1=null
//UNDEFINED
let boy ;
console.log(boy)
//COMPOSITE DATATYPES
//ARRAY[]
let names=['Alfred','May',5,1999,true]
//OBJECTS{}
let studentDetails={
name:"Alfred",
class:"12th grade",
school:"Aptech",
favcolor:"Green"
};
//FUNCTIONS
function alertMyName(){
alert('Alfred');
}
//INVOVLE OR CALLING FUNCTION
//DOCUMENTS.METHODS
alertMyName()
let newName='Frank';
document.write('My name is ' + newName)