DEV Community

Cover image for JS Trick Questtions
Akash Yadav
Akash Yadav

Posted on

JS Trick Questtions

const obj = {a: 1, b: 2}
const val1 = obj.c;
const val2 = obj.c || "default"; // fallback
console.log(val1)
console.log(val2)
Enter fullscreen mode Exit fullscreen mode

Top comments (0)