-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest4.js
More file actions
37 lines (28 loc) · 661 Bytes
/
Copy pathtest4.js
File metadata and controls
37 lines (28 loc) · 661 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
console.log("Hi")
const str1 = 'Mary';
const str2 = 'Army';
const sorted1=str1.toLowerCase().split('').sort().join("");
const sorted2 = str2.toLowerCase().split('').sort().join("");
console.log(sorted1);
console.log(sorted2);
if(sorted1===sorted2){
console.log("Is Anagram")
}
const m = ['a','b','c']
const mqueue=(element)=>{
return m.push(element);
}
const dqueue=()=>{
let out=[];
for(let i=m.length-1;i>=0;i--){
out.push(m[i]);
m.pop();
}
for (let i = out.length - 2; i >= 0; i--) {
//out.push(m[i]);
m.push(out[i]);
}
//console.log(out);
return out.pop();
}
console.log(dqueue(),m);