Question 34
Question
Answer
const fruits = ["apple", "banana", "orange"]; for (const fruit of fruits) { console.log(fruit); // Output each fruit in the array }
const myCustomObject = { [Symbol.toStringTag]: 'MySpecialThing' }; console.log(typeof myCustomObject); // Output: "object" console.log(Object.prototype.toString.call(myCustomObject)); // Output: "[object MySpecialThing]"
Last updated