Java javascript code example
Example 1: javascript vs java
Example 2: difference between java and javascript
java is virtualised and compiled while javascript isn't.
javascript and java aren't that similar apart from beign
both OOP.
Example 3: javascript
JavaScript, often abbreviated as JS, is a programming language that conforms
to the ECMAScript specification.
JavaScript is high-level, often just-in-time compiled, and multi-paradigm.
It has curly-bracket syntax, dynamic typing, prototype-based object-orientation,
and first-class functions.
Example 4: javascript ...
function sum(x, y, z) {
return x + y + z;
}
const numbers = [1, 2, 3];
console.log(sum(...numbers));
console.log(sum.apply(null, numbers));
function sum(...numbers) {
let sum = 0;
for (const number of numbers)
sum += number;
return sum;
}
console.log(sum(1, 2, 3, 4, 5));
console.log(sum(4, 5, ...numbers));
Example 5: javascript
heres the first bit of javascript: ("my first javascript");
alert ("YAY");