+ 1
[ Not Yet ] Spilt JS Text Prompt
So Someone Type IBM Then Said Right But If He Type Asus Then The Alert Is Wrong Board So Spilt What He Type Help
14 RĂ©ponses
+ 1
Is this what you mean?
https://code.sololearn.com/WuKkg8NFzMCA/?ref=app
+ 1
Yes But Two Text In The Correct
+ 1
// Do you mean split every word?
var text = prompt("Enter something:");
var words = text.split(" "); // Splits by each space
console.log(words);
+ 1
2 Words Intel And IBM Else Wrong
+ 1
Check the code I linked now... Iâve updated it...
I use .toLowerCase() so if you put it in upper case letters or not it will still work.
+ 1
So When He Type Not ibm Or intel I Alerdy Set A Var So In Else In The Wrong Then Not To The Next Var
+ 1
Line 1 stores the userâs input, what they type in, in the text variable.
Line 2 is an if statement: IF text is âibmâ OR text is âintelâ
Line 3 will only run if line 2 is correct - if what the user entered is ibm or intel.
Line 4 is an else statement.
Line 5 will run only if line 2 is false - if it isnât ibm or intel.
+ 1
Code?
+ 1
Itâs in the code I linked before.
Here it is again: https://code.sololearn.com/WuKkg8NFzMCA/?ref=app
0
Not To The Next Var I Alerady Try It
0
Explain clearly
0
U Can See My Coversation With Rowsej
0
As per I can see.. can't understand anything a little bit
0
wut?