-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString.js
More file actions
60 lines (43 loc) · 1.31 KB
/
Copy pathString.js
File metadata and controls
60 lines (43 loc) · 1.31 KB
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
50
51
52
53
54
55
// let str="RajaKUMAR";
// console.log(str[5]);
// let str='Rahul KUmar';
// console.log("str=",str);
//IMP
/* using templete Literals*/
/*TL is used to single line output
let obj={
Name:"raja",
branch:"CSIT",
section: "II"
}
// console.log(obj.Name);
// console.log("My name is ",obj.Name,"My branch is",obj.branch,"section is",obj.section);
let output=`My name is ${obj.Name} my secton is ${obj.section},my branch is ${obj.branch}`;
console.log(output);
*/
//$(Expression) ->string interpolation
//Escape character to add Newlines ->\n
//Tab space->\t
// let str=" HarshKumar ";
// let val=str.toUpperCase();
// console.log(val);
// let str=" HarshKumar ";
// str.trim();
// console.log(str);
// let str=" HarshKumar ";
// let val=str.trim();
// console.log(val);
// let str="Hello";
// let val=str.replace('H','y');
// console.log(val);
/* Practice question
//userName=Raja ,then @Raja4 (@+userName+sizeof username)
let userName=prompt("Enter the Name:");
let output="@"+userName+userName.length;
console.log(output);
*/
//splice methode
// let arr=[1,2,3,4,5,6,7,8];
// arr.splice(1,1,101);
// arr.splice(1,1,101,102);
// splice(startingindex,deletePosition count,addition values)