javascript - simple if statement with if -
I am trying to add a word to a string if it is not there and I have a string with a How can I fix this? You should use indexOf and string insertion Changed the array to (A) and used push to add new word but the new word is being added
(an.length - 1) bar.
var ime = "Open it now" var a = ime.split ('') var ene = "itt" (var i = 0; i
ime = ime.indexOf (ene) === -1? Ime + '' + ene: ime
Comments
Post a Comment