0

need help

let alphabet = [ ["e", "t", "a", "n", "d"], ["o", "i", "r", "u", "c"], ["s", "h", "m", "f", "p"], ["l", "y", "g", "v", "j"], ["w", "b", "x", "q", "z"]]; let tapReference=[1,0,1,0,1,0,0,0,1,0,1,0,1]; function translate(row, col, alphabet,tapReference) //{ //for(let i=-1;i <tapReference.length;i++) { if(tapReference[i]==="1" && tapReference[i+1]==="0") { i=i+1; row=i; i=-1; } else if(tapReference[i]==="0" && tapReference[i+1]==="0") { } else if(tapReference[i]==="1"||tapReference[i+1]==="0") { i=i+1; col=i; col=-1; } return alphabet[row][col]; } console.log(translate); how do i get it to output cause it cant seem to give me an output

10th Apr 2018, 11:43 AM
darque5
darque5 - avatar
3 Answers
+ 3
You never call your function.
10th Apr 2018, 11:54 AM
John Wells
John Wells - avatar
+ 3
That's not how you would call the function. It should be like this: x = translate(5, 5, alphabet, tapReference);
10th Apr 2018, 12:25 PM
Zeke Williams
Zeke Williams - avatar
0
doesnt do anything even if i call my function like such let x =translate
10th Apr 2018, 12:04 PM
darque5
darque5 - avatar