forked from MahmoudShaaban16/JavaScript-crash-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnumbers.js
More file actions
49 lines (31 loc) · 704 Bytes
/
numbers.js
File metadata and controls
49 lines (31 loc) · 704 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var num=10000;
num="";
var num2=10.57664444444;
var dec=10e10; // 100;
//console.log(dec);
num=(num*2)+3;
console.log(Math.sqrt(4));
// round up to the nearset integer
Math.round(10.5); //11
Math.round(10.4);
// complex aggregates
var n=10;
//console.log(n++);
// the same as
n+=1;
//
var st="my name is mahmoud";
var replacedString=st.replace('my','x');
//console.log(replacedString);
// substring
var st2=st.substr(3,3);
//console.log(st2);
//slice
console.log(st.slice(-3,-1));
//
var complexString="aAbCs";
/// printing the ASCII code of character
console.log(st.charCodeAt(0));
console.log("the result of 10 divided by string",10/"x");
var boolX=true;
var retNumber=Boolean(1);