Browse and practice JavaScript interview questions. Commit to an answer, then explore the explanation and run the code.
Search for a command to run...
18/155 questions
1/9
function sayHi() { console.log(name); console.log(age);
for (var i = 0; i < 3; i++) { setTimeout(() => console.log(i), 1);}
const shape = { radius: 10, diameter() {
+true;!'Lydia';
const bird = { size: 'small',};
let c = { greeting: 'Hey!' };let d;
let a = 3;let b = new Number(3);let c = 3;
class Chameleon { static colorChange(newColor) { this.newColor = newColor;
let greeting;greetign = {}; // Typo!console.log(greetign);
function bark() { console.log('Woof!');}
function Person(firstName, lastName) { this.firstName = firstName; this.lastName = lastName;
function sum(a, b) { return a + b;}
let number = 0;console.log(number++);console.log(++number);
function getPersonInfo(one, two, three) { console.log(one); console.log(two);
function checkAge(data) { if (data === { age: 18 }) { console.log('You are an adult!');