+ 1

Real world examples?

So in the real world, how is javascript actually used? Where are things like arrays or objects actually used? Why are they used? All I've seen on the internet is how to create arrays or objects, but not once have I seen or heard about real world uses for them.

28th Jun 2018, 5:06 AM
Daniel Cooper
Daniel Cooper - avatar
6 ответов
+ 6
Daniel Cooper many arrays are used in this game to store the emojis, locations, backgrounds, even the random messages. https://code.sololearn.com/WcK52cguoX6Y/?ref=app
28th Jun 2018, 5:18 AM
bobbie
bobbie - avatar
+ 4
because of php , javascript arrays are less used
28th Jun 2018, 5:16 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 3
Hello, Daniel Cooper ! Arrays are the same objects, but with their methods and chips (Uncle Array's children), such as length, sort, join, splice, slice, etc. They have a clear order, because the keys are represented as consecutive numbers. And this is the main reason for using them - they can be shredded, sorted, and added into them new values ​​at certain points. In fact, ["A", "B", "C"] can be represented as a new Array ("A", "B", "C") and hence as {0: "A", 1: "B", 2 : "C"}. Learn more with SoloLearn. Good luck! https://www.sololearn.com/learn/JavaScript/1240/?ref=app
28th Jun 2018, 5:09 AM
Alexander Sokolov
Alexander Sokolov - avatar
28th Jun 2018, 5:14 AM
Alexander Sokolov
Alexander Sokolov - avatar
0
I know what they are. But how do web developers actually use these?
28th Jun 2018, 5:11 AM
Daniel Cooper
Daniel Cooper - avatar
0
Array and object are used a lot on Javascript especially in API access, All api data is formatted in objects and arrays form. You also use Javascript array to populate your data (from api) to class element eg. getElementsByClassName("clsname") array or table td elements. You use object in modular object oriented programming to initiate all class modules.
6th Jul 2018, 9:12 AM
Calviղ
Calviղ - avatar