Javascript examples for Statement:if
Remove whitespace in String with for and if statement
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){/*w ww.j a va2 s . c om*/ var x = "Enter sum"; var v=''; for (var i=0; i<=x.length;i++) { if (x[i] != " ") { v +=x[i]; } } console.log(v); } </script> </head> <body> </body> </html>