+2 william appiah-dankwah · June 10, 2014
i have made an array witch i want to try and use other statements i have learnt to finish of the code, hears my code what can i add to it to make it more interesting 

var gold = new Array();

gold[0] = "goddfellaz";
gold[1] = "sk vibemakers"
gold[2] = "heartless crew"
gold[3] = "rolldeep"
gold[4] = "wolfpack"
gold[5] = "payasyougo"

Post a Reply


- page 2
Oldest  Newest  Rating
0 william appiah-dankwah · March 30, 2015
Yeah it does not work iv tried that format already 
0 michael walker · March 30, 2015
try maybe instead of arrayName.join() how about the toString method??
0 william appiah-dankwah · March 30, 2015
is it hard to do an array with images?
0 william appiah-dankwah · March 30, 2015

function Yellow(){
var look = document.getElementById('Plane');
var List = new Array(); 
 List[0] = new Image;
 List[0].src = "pic/photo-1.JPG";
 List[1] = new Image;
 List[1].src = "pic/photo-2.JPG";
 List[2] = new Image;
 List[2].src = "pic/photo-3.JPG";

look.innerHTML += List[0];


any ideas?

0 william appiah-dankwah · March 31, 2015

Function Name(){

var Image Array
Image[0] = new Image;
Image[0].src = "pic/photo.JPG";

for(i = 0;i < 5;  i++){
var plane = document.getElement.ById('like');

why isnt the loop working for this? 
0 Sho Carter · April 1, 2015
Hi William 

There are plenty errors in your code:

#1 - "Function" should be lower case.
#2 - "Image" is a reserved name for JavaScript Image object.
#3 - You forgot to put a semi-colon to end the first line. 
#4 - In your loop, you typed "getElement.ById" instead of "getElementById".

I've corrected the issues and placed it below:

0 william appiah-dankwah · April 1, 2015
That's not why my loop don't work calling functions like that does not always work do they talk about hacking on this site? By the way just to clear it up its a typo not sure why
0 Sho Carter · April 1, 2015
Calling functions will only trigger the code inside it. That is how you call a function....
I doubt Bucky would talk about hacking on here...

Btw, I've replaced the code with an image from my text editor, as it won't let me show properly....
0 william appiah-dankwah · April 2, 2015
Yeah it does not work sometimes 
0 Sho Carter · April 2, 2015
That function displayed above works well, and the only possible reasons why it may not work for you could be for the fact that you may have syntax error in your code elsewhere, as what I've shown you (above) is correct (syntax wise).



A scripting language that is added to standard HTML to create interactive effects, apps, games for the browser.