javascript - How can I push a null value into the start of an array? -
I have this code that brings data and puts it in an array:
This $ httpGetTest (this.test.testId) .success (function (Data: ITestQuestion []) {self.test.qs = data;}); This works and generates an array starting with self.test.qs [0].
Although sometimes my code refers to this array (which contains a list of questions 1 ... x)
Let me always reduce the question number to 1 and So my code does not look clear. Is there any way that I can enter the array in front of all other people so that:
self.test.qs [0] is empty self.test.qs [1] Reference Question First actual data for number 1 Ideally I would like to do this after entering self.test.qs = and after the code .
From the beginning of the array
self.test.qs.unshift (Zero);
Comments
Post a Comment