-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
122 lines (93 loc) Β· 1.88 KB
/
test.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// cd
// function *generator(){
// for(let i=2;i<100;i++)
// {
// let count=0
// for(let j=2;j<i;j++)
// {
// if(i%j==0){
// count++
// break
// }
// }
// primeNumbers
// }
// }
// let k=generator()
// console.log(k.next())
// let obj={
// name:"ajmal",
// age:19
// }
// let obj2={
// name:"john",
// age:22
// }
// function printName(place){
// console.log(`Hi my Name is ${this.name}iam From ${place}`)
// }
// printName.call(obj2,"kerala")
// printName.apply(obj2,["kerala"])
// let k=printName.bind(obj2,"kerala")
// k()
// let str="aaccbbaagc"
// let map=new Map()
// for(let i=0;i<str.length;i++)
// {
// map.set(str[i],map.get(str[i])+1||1)
// }
// console.log(map)
// class Node{
// constructor(val)
// {
// this.val=val
// this.next=null
// }
// }
// class Queue{
// constructor()
// {
// this.start=null
// this.peek=null
// }
// enqueue(val)
// {
// let newNode=new Node(val)
// if(!this.start)
// {
// this.start=newNode
// this.peek=newNode
// }else{
// this.peek.next=newNode
// this.peek=newNode
// }
// }
// dequeue()
// {
// let val=this.start.val
// this.start=this.start.next
// return val
// }
// display()
// {
// let curr=this.start
// while(curr)
// {
// console.log(curr.val)
// curr=curr.next
// }
// }
// }
// let obj=new Queue()
// obj.enqueue(10)
// obj.enqueue(20)
// obj.enqueue(30)
// obj.enqueue(40)
// obj.enqueue(50)
// obj.display()
// console.log("deleted value",obj.dequeue())
let str="helo ajmEl"
str[1]="k"
console.log(str.replaceAll('e', 'z'));
console.log(str);
// console.log(k);