I was experimenting with Uint16Array()
(which is something new to me in js) and I created an array of 5 numbers like so:
var test = new Uint16Array(5);
then assigned a number to each cell.
then when I tried in my console typeof
test returned "object"
although when I did alert(test)
the message-box returned [object Uint16Array]
.My question is how can I check the exact type of the variable / array "test" like alert returned?
Correct me if I'm mistaken but wouldn't this be more efficient, to use specific variable types for your data and furthermore is it supported from major browsers?
Thank you in advance.