printAll(elements) {
Let 'i' equal to zero
Let 'len' equal to length of 'elements'
While 'i' is less than 'len'
Let 'nextElement' equal to the element in 'elements' at index 'i'
Call nextElement's toString method and print result
Let 'i' equal to 'i' plus 1
}
function printAll(elements) { let len = elements.length let i = 0 while (i < len) { let nextElem = elements[i] println(nextElement.toString()) i = i + 1 } } //try it
let len = elements.length let i = 0
while (i < len) {
while (i >= 0) {
let nextElem = elements[i]
println(nextElem.toString())
i = i + 1
}
elements = [Riya, Asha, Chin]
[Riya, Asha, Chin] printAll(elements) {
0 let i = 0 3 let len = elements.length
0 3 while (i < len) { Riya 0 let nextElem = elements[i] Riya println(nextElement.toString()) 1 0 i = i + 1 }
1 3 while (i < len) { Asha 1 let nextElem = elements[i] Asha println(nextElement.toString()) 2 1 i = i + 1 }
2 3 while (i < len) { Chin 2 let nextElem = elements[i] Chin println(nextElement.toString()) 3 2 i = i + 1 }
3 3
while (i < len) {