Skip to content

gtanchak/js-question

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 

Repository files navigation

JavaScript Questions

Feel free to reach out to me! 😊

LinkedIn || Twitter


1. What's the index of specific character?
"BOOMIN".indexOf("O");
  • A: 2
  • B: 1
  • C: 3
  • D: -1

2. What's the output?
let friendsAtParty = 20;
while (friendsAtParty > 10) {
  friendsAtParty = friendsAtParty + 1;
}
console.log(friendsAtParty);
  • A: true
  • B: false
  • C: Infinite
  • D: undefined

3. What's the output?
"BOOMIN".indexOf("o"); // Here `o` is small.
  • A: 2
  • B: 1
  • C: 3
  • D: -1

4. What's the output?
let answerToLife = 4 + 1 * 2 * 4 + 2;
console.log(answerToLife);
  • A: 42
  • B: 14
  • C: 16
  • D: 40

5. What's the output?
let boomin = [100, 50, 2].sort();
console.log(boomin);
  • A: [2, 50, 100]
  • B: [100, 50, 2]
  • C: [100, 2, 50]
  • D: [2, 100, 50]

6. What's the output?
let abc = "abc";
abc[1] = "d";
console.log(abc);
  • A: "d"
  • B: "abc"
  • C: "adc"
  • D: error

7. What's the output?
let boomin = [1, 2, 3];
result = boomin.concat(4);
console.log(boomin);
  • A: [1,2,3]
  • B: [1,2,3,4]
  • C: 4
  • D: [1,2,3,[4]]

8. Which one is a non-primitive data type?
  • A: boolean
  • B: Array
  • C: String
  • D: Number

9. What's the output?
function getAge(...args) {
  console.log(typeof args);
}

getAge(21);
  • A: "number"
  • B: "array"
  • C: "object"
  • D: "NaN"

10. String in Javascript are editable value?
  • A: true
  • B: false

11. What's the output?
function doesThisWork("Boomin") {
  return true
}
  • A: true
  • B: undefined
  • C: SyntaxError
  • D: false

About

JavaScript Questions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published