+ 2
I see, you try to check if the sq root contains a "." How about this? // make sure it's a string let s = Math.sqrt(txt).toString(); // use includes() if (!s.includes("."))
22nd May 2022, 6:42 PM
Lisa
Lisa - avatar
+ 1
What are we supposed to input?
22nd May 2022, 6:37 PM
Lisa
Lisa - avatar
+ 1
"!" means "not", it negates the boolean: ! true is false
22nd May 2022, 6:51 PM
Lisa
Lisa - avatar
0
// Your Mom , Hope this code helps you function morseCode() { for (var i = 0; i < txt.length; i++) { switch (txt.charAt(i)) { case "a": morse += " •-"; break; case "b": morse += " -•••"; break; case "c": morse += " -•-•"; break; default: morse += ""; } } console.log(morse); }
23rd May 2022, 2:33 AM
SoloProg
SoloProg - avatar