Daily JavaScript
15 subscribers
1 photo
1 link
Daily examples, coding challenges, and useful tips for developers.
Download Telegram
48. What's the output?

console.log(3 + 4 + '5');
Anonymous Quiz
0%
A: "345"
100%
B: "75"
0%
C: 12
0%
D: "12"
49. What's the value of num?

const num = parseInt('7*6', 10);
Anonymous Quiz
0%
A: 42
0%
B: "42"
100%
C: 7
0%
D: NaN
50. What's the output?

[1, 2, 3].map(num => {
if (typeof num === 'number') return;
return num * 2;
});
51. What's the output?

function getInfo(member, year) {
member.name = 'Lydia';
year = '1998';
}

const person = { name: 'Sarah' };
const birthYear = '1997';

getInfo(person, birthYear);

console.log(person, birthYear);
52. What's the output?

function greeting() {
throw 'Hello world!';
}

function sayHi() {
try {
const data = greeting();
console.log('It worked!', data);
} catch (e) {
console.log('Oh no an error:', e);
}
}

sayHi();
53. What's the output?

function Car() {
this.make = 'Lamborghini';
return { make: 'Maserati' };
}

const myCar = new Car();
console.log(myCar.make);
53. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: "Lamborghini"
100%
B: "Maserati"
0%
C: ReferenceError
0%
D: TypeError
54. What's the output?

(() => {
let x = (y = 10);
})();

console.log(typeof x);
console.log(typeof y);
55. What's the output?

class Dog {
constructor(name) {
this.name = name;
}
}

Dog.prototype.bark = function() {
console.log(`Woof I am ${this.name}`);
};

const pet = new Dog('Mara');

pet.bark();

delete Dog.prototype.bark;

pet.bark();
56. What's the output?

const set = new Set([1, 1, 2, 3, 4]);

console.log(set);
57. What's the output?

// counter.js
let counter = 10;
export default counter;

// index.js
import myCounter from './counter';

myCounter += 1;

console.log(myCounter);
57. What's the output?

Javob variantlari:
Anonymous Quiz
0%
A: 10
0%
B: 11
100%
C: Error
0%
D: NaN
58. What's the output?

const name = 'Lydia';
age = 21;

console.log(delete name);
console.log(delete age);
58. What's the output?

Javob variantlari:
Anonymous Quiz
100%
A: false, true
0%
B: "Lydia", 21
0%
C: true, true
0%
D: undefined, undefined
59. What's the output?

const numbers = [1, 2, 3, 4, 5];
const [y] = numbers;

console.log(y);