ES6 面接の質問と回答
質問 26. Explain the 'Array.includes()' method in ES6.
Array.includes() is used to check if an array includes a certain element, returning true or false.
Example:
const numbers = [1, 2, 3, 4, 5]; const includesThree = numbers.includes(3);
役に立ちましたか?
コメントを追加
コメントを見る
質問 27. What is the 'Object.entries()' method in ES6?
Object.entries() is used to return an array of a given object's own enumerable string-keyed property [key, value] pairs.
Example:
const obj = { a: 1, b: 2 }; const entries = Object.entries(obj);
役に立ちましたか?
コメントを追加
コメントを見る
質問 28. Explain the 'Object.keys()' method in ES6.
Object.keys() is used to return an array of a given object's own enumerable string-keyed property names.
Example:
const obj = { a: 1, b: 2 }; const keys = Object.keys(obj);
役に立ちましたか?
コメントを追加
コメントを見る
質問 29. What is the purpose of the 'Object.values()' method in ES6?
Object.values() is used to return an array of a given object's own enumerable string-keyed property values.
Example:
const obj = { a: 1, b: 2 }; const values = Object.values(obj);
役に立ちましたか?
コメントを追加
コメントを見る
質問 30. Explain the concept of the 'for...of' loop in ES6.
The 'for...of' loop is used to iterate over values in an iterable object, such as an array, string, or Map.
Example:
const arr = [1, 2, 3]; for (const num of arr) { console.log(num); }
役に立ちましたか?
コメントを追加
コメントを見る
ユーザー評価で最も役立つ内容: