?? javascript
❤ We will always love you javascript! ❤
${} js
let x = 5;
console.log("hello world " + x + " times");
console.log(`hello world ${x} times`);
... javascript
/* Spread syntax ( ex. ...arrayName) allows an iterable such as an array expression or string
to be expanded in places where zero or more arguments (for function calls)
elements (for array literals) are expected, or an object expression to be
expanded in places where zero or more key-value pairs (for object literals)
are expected. */
//example
function sum(x, y, z) {
return x + y + z;
}
javascript
JavaScript is an much used scripting language that is much used to make webpages
and webapplications.
Release Date: 4th of December 1995
Javascript Is Made By: Brendan Eich
javascript
('b' + 'a' + + 'a' + 'a').toLowerCase() == 'banana'
Javascript
//Javascript is a programming language that can be used with HTML.
//These are variables:
var userName = "Name";
/*A variable has to have a var keyword, a name and a value.
The value can also be a operator.*/
var year = 2021;
//Operators don't need to have quotation marks.
function hi(){
alert("Hello");
}
/*Functions have the function keyword, a pair of curly braces,
and a statement inside them.*/
if(userName == "Name") {
hi();
}
//These are called if statements (The one above)
if(userName == "Name") {
hi();
}
else {
return false;
}
//These are called else statements.
/*There are also javascript APIs called DOMs.(Document Object Model)
This is a DOM statement called getElementById, the most popular statement.*/
//There are also statements like createElement and appendChild. This is a basic code.
var hello = document.createElement("div");
hello.innerHTML = document.getElementById("box");
document.getElementById("list").appendChild(hello);
//There are also localstorage APIs.
localStorage.storedList = document.getElementById("list").innerHTML;
//And for loops
var(for i = 0; i < list.children.length; i++) {
list.children[i].onclick = hello;
}
//Operators with loops
var loops = 0;
loops++
//Operators with loops and if statements
var loops = 0;
if(loops < 12) {
return false;
}
//Operators with loops and else statements
var loops = 0;
if(loops < 12) {
return false;
}
else {
loops++
}
//Timers with the setTimeout call
var count = 0;
count++
document.getElementById("list").innerHTML;
setTimeout(loops, 1000);
//Operators with loops and else statements with setTimeout calls
var loops = 0;
if(loops < 12) {
return false;
}
else {
setTimeout(gameLoop, 1000);
}
//This is the number of milliseconds before the computer releases the next loop.
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us