JavaScript Brain Teaser: Predict the output of this code

🧩 JavaScript Brain Teaser of the Day! Can you predict the output? 👇 const getValues = () => [1, (a) => a = 20, 3]; const [b, a, c] = getValues(); console.log(a(5), c); What will it print in the console? 🤔 A) 5 3 B) 20 3 C) undefined 3 D) Error #JavaScript #CodingChallenge #WebDevelopment #ES6 #Destructuring #InterviewQuestions #Frontend #nodejs #chatgpt #AI #product #Interviews #Frontend #CareerGrowth

Option B ) 20 3 Still could get why was it a brain teaser 🙂

Like
Reply

To view or add a comment, sign in

Explore content categories