+ 6

Javascript coding question

this may seem very stupit but i have no idea,am just asking what is the difference between switch statements ,an array and and an object in JavaScript ,i knw they all store many values but I have no idea which is used where,,,little help

13th Oct 2017, 5:20 PM
_c0dÂŁ BitÂŁ_
_c0dÂŁ BitÂŁ_ - avatar
2 Answers
+ 3
First of all, switch doesnt store a value but rather checks a value against options, which is comparable to if-statements. Next, think of an array as an container of variables that all have the same data type, so you use it if you need to store some more variables of the same data type. Last, an object is somewhat similar to an array, but it can have variables of different data types, and those are written in key::value pairs instead of simple index numbers. You usually use objects to represent things from the real world.
13th Oct 2017, 5:39 PM
Shadow
Shadow - avatar
0
no
25th Aug 2018, 9:52 AM
ADEL DID NOT WAKE UP
ADEL DID NOT WAKE UP - avatar