[ Not Yet ] Spilt JS Text Prompt | Sololearn: Learn to code for FREE!
+ 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

21st Aug 2020, 3:19 PM
Catafrancia Mapper
Catafrancia Mapper - avatar
14 Réponses
22nd Aug 2020, 1:28 AM
Rowsej
Rowsej - avatar
+ 1
Yes But Two Text In The Correct
22nd Aug 2020, 2:10 AM
Catafrancia Mapper
Catafrancia Mapper - avatar
+ 1
// Do you mean split every word? var text = prompt("Enter something:"); var words = text.split(" "); // Splits by each space console.log(words);
22nd Aug 2020, 2:14 AM
Rowsej
Rowsej - avatar
+ 1
2 Words Intel And IBM Else Wrong
22nd Aug 2020, 2:15 AM
Catafrancia Mapper
Catafrancia Mapper - avatar
+ 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.
22nd Aug 2020, 2:18 AM
Rowsej
Rowsej - avatar
+ 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
22nd Aug 2020, 2:45 AM
Catafrancia Mapper
Catafrancia Mapper - avatar
+ 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.
22nd Aug 2020, 2:58 AM
Rowsej
Rowsej - avatar
+ 1
Code?
22nd Aug 2020, 7:14 AM
Catafrancia Mapper
Catafrancia Mapper - avatar
+ 1
It’s in the code I linked before. Here it is again: https://code.sololearn.com/WuKkg8NFzMCA/?ref=app
22nd Aug 2020, 7:17 AM
Rowsej
Rowsej - avatar
0
Not To The Next Var I Alerady Try It
22nd Aug 2020, 2:51 PM
Catafrancia Mapper
Catafrancia Mapper - avatar
0
Explain clearly
23rd Aug 2020, 11:45 AM
[B.S.] BITTU
[B.S.] BITTU - avatar
0
U Can See My Coversation With Rowsej
23rd Aug 2020, 12:29 PM
Catafrancia Mapper
Catafrancia Mapper - avatar
0
As per I can see.. can't understand anything a little bit
23rd Aug 2020, 12:31 PM
[B.S.] BITTU
[B.S.] BITTU - avatar
0
wut?
12th Sep 2020, 11:39 PM
Catafrancia Mapper
Catafrancia Mapper - avatar