coding with ☕️
2 subscribers
262 photos
14 videos
11 files
165 links
Anwendungsentwicklung
Download Telegram
let message;
message = 'Hello!';

alert(message);
alert( 1 / 0 ); // Infinity
alert( Infinity ); // Infinity
let name = "John";

// embed a variable
alert( `Hello, ${name}!` ); // Hello, John!

// embed an expression
alert( `the result is ${1 + 2}` ); // the result is 3
let name = "Ilya";

alert( `hello ${1}` ); // ?

alert( `hello ${"name"}` ); // ?

alert( `hello ${name}` ); // ?
number for numbers of any kind: integer or floating-point, integers are limited by ±(253-1).
bigint for integer numbers of arbitrary length.
string for strings. A string may have zero or more characters, there’s no separate single-character type.
boolean for true/false.
null for unknown values – a standalone type that has a single value null.
undefined for unassigned values – a standalone type that has a single value undefined.
symbol for unique identifiers.
And one non-primitive data type:
object for more complex data structures.
let age = prompt('How old are you?', 100);

alert(`You are ${age} years old!`); // You are 100 years old!
The function confirm shows a modal window with a question and two buttons: OK and Cancel.

The result is true if OK is pressed and false otherwise.

Not unic
let isBoss = confirm("Are you the boss?");

alert( isBoss ); // true if OK is pressed
let year = prompt('In which year was the ECMAScript-2015 specification published?', '');

if (year < 2015) {
alert( 'Too early...' );
} else if (year > 2015) {
alert( 'Too late' );
} else {
alert( 'Exactly!' );
}