Every line of 'print hello world in javascript' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.
1 function hello(name) { 2 alert("Hello "+ name); 3 }
1 export function sayHello(name) { 2 return 'Hello ' + name; 3 }
32 function hello() { 33 34 var dots = document.getElementById("dots"); 35 36 // After "app" content has loaded, no need to continue 37 if (!dots) { 38 return; 39 } 40 41 dots.innerHTML = direction ? `${dots.innerHTML}.` : dots.innerHTML.slice(0, -1); 42 43 // Change direction 44 var len = dots.innerHTML.length; 45 if (len === 6) { 46 direction = false; 47 } else if (len === 1) { 48 direction = true; 49 } 50 51 setTimeout(hello, 400); 52 }