-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
56 lines (45 loc) · 1.35 KB
/
script.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
49
50
51
52
53
54
55
56
console.log("Strings");
// //print vowels
// setTimeout(() => {
// console.log("A");
// }, 1000);
// setTimeout(() => {
// console.log("E");
// }, 2000);
// setTimeout(() => {
// console.log("I");
// }, 3000);
// setTimeout(() => {
// console.log("O");
// }, 4000);
// setTimeout(() => {
// console.log("U\");
// }, 5000);
//print vowels using in 5,4,3,2,1s but in order A,E,I,O,U
// String is a sequence of one or more characters that amay consists of letters,numbers or symbols.
// it is primritave and immutable.caretet an string using
//using single quote'',double quote"",backtics``
//acess string characters
// const a ='hello';
// console.log(a[1]);
// console.log(a.charAt(1));
// //immutable example
// a[0]='H';
// console.log(a);//it give same //hello
// //case sensitive
// const a='a';//lower and upper case are not same
// const b ='A';
// console.log(a===b)//false
//multiline string
//u can use + operator or / operator
//for new line (/n)
// const A = 'hello';
// console.log(A.length);//5
//String objects
// const a = 'hello';
// const b= new String('hello');
// console.log(a);//hello
// console.log(b);//hello
// console.log(typeof b);//object
// console.log(typeof a);//string
// Arrays and string methods are same