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
Can you take the code from a Joomla Template and its modular layout, copy a "generic" version of the pages code and paste the code in when you need the same kind of page layout. If so how?
SQL 2005 Modify SSIS created in Import Export Wizard
Maximum NVIDIA GeForce 8800 GTS Temperature
Extract data from a set point in a string
HTTP 403 Forbidden error in WordPress installation
PHP + MSSQL
problem when I publish a Web page and XMl
saving data to text
economical for farmers to feed grass in summer (& customers also?)
How to disconnect idle user on vty line?