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
3 Answers
+ 3
You never call your function.
+ 3
That's not how you would call the function. It should be like this:
x = translate(5, 5, alphabet, tapReference);
0
doesnt do anything even if i call my function
like such let x =translate