js %
<script type="text/javascript"></script>
4.5
4
let x = 5;
console.log("hello world " + x + " times");
console.log(`hello world ${x} times`);
Thank you!
4
0
4
2
/*
You can run javascript into console,
- ctrl+shift+i (inspect)
- Select console
- and write the javascript code
*/
document.body.innerHTML = "Hello World"; //change the body
Thank you!
2
0
4.33
9
JavaScript is a Object-Oriented Programming Language. It is very easy, making it high level.
Thank you!
9
0
0
6
/*The remainder operator (%) returns the remainder left
over when one operand is divided by a second operand.
It always takes the sign of the dividend.*/
console.log(12 % 5);
// expected output: 2
console.log(-12 % 5);
// expected output: -2
console.log(4 % 2);
// expected output: 0
console.log(-4 % 2);
// expected output: -0
Thank you!
6
0
5
2
<script>
function f1() {
var msg="this is the first program of javascript";
document.write("hello "+msg.length);
}
</script>
Thank you!
2
0
Are there any code examples left?
New code examples in category Javascript