+ 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.
6 Antworten
+ 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
+ 4
because of php , javascript arrays are less used
+ 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
0
I know what they are. But how do web developers actually use these?
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.