Answers for "js variable in html"

4

js variables

//Making variables with let:
let numberOfFriends = 1;

//Incrementing:
numberOfFriends += 3; //numberOfFriends is now 4

// Variables with const
const minimumAge = 21; //CANNOT REASSIGN!

//Booleans - true or false values
true;
false;
let isHappy = true;

//Naming Conventions
// Use upper camel-cased names:
let numberOfChickens = 6; //GOOD
// NOT THE JS WAY:
// let number_of_chickens = 6;
Posted by: Guest on January-04-2021
-2

js variable html

<div onload="document.innerHTML(name + ' is ' + age)">
Posted by: Guest on April-14-2020
0

js var

var a = 'A';
var b = a;

// è come dire:

var a, b = a = 'A';
Posted by: Guest on January-04-2021
0

js var

var a = 1;
b = 2;

delete this.a; // Genera un TypeError in strict mode. Altrimenti fallisce senza generare messaggi.
delete this.b;

console.log(a, b); // Genera un ReferenceError.
// La proprietà 'b' è stata cancellata e non esiste più.
Posted by: Guest on January-04-2021
-2

html define javascript variable

<script>
var Number = 5;
var String = "Hi!";
var boolen1 = true;
var boolen2 = false;
var array = [11, "Hi!", true];
var object = {age:11, speach:"Hi!", likes_Bananas:true};
</script>
Posted by: Guest on December-28-2020

Browse Popular Code Answers by Language