-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
63 lines (37 loc) · 1.28 KB
/
Copy pathapp.js
File metadata and controls
63 lines (37 loc) · 1.28 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
56
57
58
59
60
const userName = "Arun"
console.log(typeof userName)
const user = new String("Arun")
console.log(typeof user)
const name = "Arun Kumar"
console.log(name.length)
console.log(name.charAt(0));
console.log(name.charCodeAt(0))
const firstName = "Arun";
const lastName = "Kumar";
console.log(firstName.concat(" ").concat(lastName))
console.log(`${firstName} ${lastName}`)
console.log(firstName[0])
console.log(firstName.startsWith("z"))
console.log(firstName.endsWith("n"))
const str = "Welcome"
console.log(str.slice(1,2))
console.log(str.slice(-3))
console.log(str.substring(1,2))
console.log(str.substring(1,-1))
// console.log(str.substring(-2)) // not supports
const str1 = " Arun "
console.log(str1)
console.log(str1.trim())
console.log(str1.trimStart())
console.log(str1.trimEnd())
const paragraph = "The rain fell Softly, softly on the rooftops, softly on the streets, softly on the trees."
console.log(paragraph.replace(/softly/,"soft"))
console.log(paragraph.replace(/softly/i,"soft"))
console.log(paragraph.replace(/softly/ig,"soft"))
const words = "apple,banana,cherry,date,elderberry,fig,grape"
console.log(words.split(","))
console.log(words.split(","))
const str2 = "ABC"
console.log(str2.toLowerCase())
const str3 = "abc"
console.log(str3.toUpperCase());