Techstacker
Light ModeDark ModeReset dark mode. Falls back to OS dark mode setting.

Pages

No results for 'undefined'

Blog Posts

No results for 'undefined'
Powered by Algolia

How to Find Specific Element in Array and Modify It (JavaScript)

Sep 28, 20171 min readJavaScriptViews:

Computers start counting from zero. So 0 is 1, 1 is 2, and so on. That’s why list[2] selects item 3 from the array

Code for the array in the example:


var list = ['item 1', 'item 2', 'item 3', 'item 4']
© 2019 - TechStacker
Powered byGatsbyGithubNetlify