javascript - What is wrong with this code i have writtten? -



javascript - What is wrong with this code i have writtten? -

i'm trying create of constants have op next them nil working. javascript code here.

class="snippet-code-js lang-js prettyprint-override">function opishconversion(text) { var output = ""; (var = 0; < text.length; = + 1) { if ((text.charat[i] !== "a") || (text.charat[i] !== "a") || (text.charat[i] !== "e") || (text.charat[i] !== "e") || (text.charat[i] !== "i") || (text.charat[i] !== "i") || (text.charat[i] !== "o") || (text.charat[i] !== "o") || (text.charat[i] !== "u") || (text.charat[i] !== "u")) { output += text.charat[i] + "op"; } else { output += text.charat[i]; } } homecoming output; } var text = prompt("enter text convert"); alert(opishconversion(text));

any help appreciated.

charat native method of string primitive. should charat(i) not charat[i]

javascript function

Comments

Popular posts from this blog

c - Compilation of a code: unkown type name string -

java - Bypassing "final local variable defined in an enclosing type" -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -