var names = [45, 456, 102, 111];
names.sort();
⤵️ What will be the sorted array?
names.sort();
⤵️ What will be the sorted array?
Anonymous Quiz
17%
[45, 456, 102, 111]
58%
[45, 102, 111, 456]
8%
[102, 111, 45, 456]
17%
[45, 456, 111, 102]
let fruits = ["apple", "orange", "apple", "banana", "grapes"];
let duplicatesRemovedFruitsArray = fruits.filter(
(currentValue, index, arr) => {
return arr.indexOf(currentValue) == index;
}
);
console.log(duplicatesRemovedFruitsArray);
let duplicatesRemovedFruitsArray = fruits.filter(
(currentValue, index, arr) => {
return arr.indexOf(currentValue) == index;
}
);
console.log(duplicatesRemovedFruitsArray);
let fruits = ["apple", "orange", "apple", "banana", "grapes"];
let duplicatesRemovedFruitsArray = [...new Set(fruits)];
console.log(duplicatesRemovedFruitsArray);
let duplicatesRemovedFruitsArray = [...new Set(fruits)];
console.log(duplicatesRemovedFruitsArray);
index.html
3.4 KB
Source code for the Canvas Bubble shared in instagram as reel.
What are the three important manipulations done in a for loop on a loop variable?
Anonymous Quiz
21%
Testing, Updation, Testing
36%
Initialization,Testing, Updation
14%
Updation, Incrementation, Initialization
29%
Initialization,Testing, Incrementation
let y = 6, x = 0;
do{ console.log(y); x++; }
while(x < 3);
do{ console.log(y); x++; }
while(x < 3);
Anonymous Quiz
25%
6
13%
0
19%
Three 0
44%
Three 6
let str = "abc";
let arr = [1, 2, 3];
str.length = 1; arr.length = 2; console.log(str.length + arr.length);
let arr = [1, 2, 3];
str.length = 1; arr.length = 2; console.log(str.length + arr.length);
Anonymous Quiz
57%
3
21%
4
21%
5
0%
6
let b = typeof class car{};
console.log(b);
console.log(b);
Anonymous Quiz
27%
class
20%
function
53%
object
0%
character
How do you run a function once after a certain amount of time?
Anonymous Quiz
10%
runOnce()
50%
setTimeout()
40%
setInterval()
Guess the output!
var a;
if(x=1) console.log("1"); else console.log("0");
var a;
if(x=1) console.log("1"); else console.log("0");
Anonymous Quiz
45%
0
40%
1
8%
01
8%
10