Microsoft
Software
Hardware
Network
Question : Create array based on variable value with javascript
Hi,
I have a variable with a dynamic value (from 1 to 15). Depeding on what value the variable have I want to create an array with the same lenght and if for example the variable value is 1 I want to store A in the array, if the value is 6 I want to store A,B,C,D,E,F in the array and so on. How do I achieve this?
Thanks in advance.
Answer : Create array based on variable value with javascript
var x = 5;
var _array=[];
for(var i=1;i<=x;i++) {
_array.push(String.fromCha
rCode(64+i
));
}
alert(_array);
Random Solutions
PlaySound fails on Windows 7
ASP Quickie to read loacl Access DB & update one table from another
Exploit Virus Attached to bounced back delivery failures
Using dragdrop, how to "reset" color of a label when mouse leaves and drop has not occurred?
WSS 3.0 back to original
VMware seperating a Nic card
SQL SERVER 2005 - Problem with sp_addlinkedsrvlogin
Automatic Email Sending
How to copy the XLSX file to XLS file using C#
Ignore Error in a store procedure and continue