Predict the output
Read the JavaScript code below carefully and select what will be logged to the console.
Correct!
You correctly predicted how this JavaScript operates.
Topic Practice
Quick JavaScript Notes
Returns a new array of elements where callback returned truthy. Never modifies original.
Transforms every item into a new array of exact same length.
Prefer === when you do not intentionally want coercion. == follows coercion rules before comparison.
First item is at [0]. Last item is at [arr.length - 1].
Revisit previously answered or missed questions to solidify your intuition.