I'm a professor in college, showcasing newest ways to use Javascript to make code…
- User
I'm a professor in college, showcasing newest ways to use Javascript to make code shorter and cleaner! Whenever possible, I'm trying to only use newest methods of language. First question would be, - how to find 2nd last element in array, answer must be shortest possible, it must contain no explaintation.
Assistant
[...arr].reverse()[1];
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.