+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 4
Oldest  Newest  Rating
0 michael walker · March 30, 2015
event simpler way to display items from an array would be
var ArrayName = new Array("value1","value2"); - 

var printArray = ArrayName.join(" - ");  - note: .join("[can be any separator for the output you want]") default = ,


value1 - value2
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 Sho Carter · April 5, 2015
Of course i noticed that, and that's because of syntax errors, and in my code, you can add another image in the array, and loop over that....quite straight forward actually, and yes, it can also run over a loop over a few second interval...i can do that too, but depends on if it's what you wanted.
0 oluseyi obafemi · April 5, 2015
Provide a function called findWordSize that takes as arguments an array of String
and a number (length of word) and returns -1 if the a word of length equal to the
number, provided in the argument, is not found; otherwise returns the index of the
word which has length equal to number provided in the argument.
For example if the array is {“Program”, “Array”, “Code”, “Algorithm”, “Loop”} and the
number argument is 5, then the function will return 1, which corresponds to the
position of the word “Array” which is of length 5. Can anyone help to write the code for this question please. Cheers
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? 
-1 william appiah-dankwah · June 11, 2014
Console.log does not work I have tried document.write and it prints out the code not sure we're you get < array.length and console.log from
-6 Ethan Fraser · June 11, 2014

var arrayName = new Array();

arrayName[0] = "String 1";
arrayName[1] = "String 2";
arrayName[2] = "String 3";
arrayName[3] = "String 4";
arrayName[4] = "String 5";

for (var i = 0; i < arrayName.length; i++) {


var arrayName = ["String 1", "String 1", "String 1", "String 1", "String 1"];

for (var i = 0; i < arrayName.length; i++) {

Both can be used to display the contents of an array.



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