Forwarded from coding with ☕️
Addition +,
Subtraction -,
Multiplication *,
Division /,
Remainder %,
Exponentiation **.
Forwarded from coding with ☕️
alert( 6 - '2' ); // 4, converts '2' to a number
alert( '6' / '2' ); // 3, converts both operands to numbers
Forwarded from coding with ☕️
Katta/kichik: a > b, a < b.
Katta/kichik yoki teng: a >= b, a <= b.
Teng: a == b, esda tutingki, qo'shaloq tenglik belgisi == tenglik testini bildiradi, bitta a = b esa topshiriqni bildiradi.
Teng emas: matematikada yozuv ≠, lekin JavaScript-da u != b shaklida yozilgan.
Forwarded from coding with ☕️
Katta/kichik: a > b, a < b.
Katta/kichik yoki teng: a >= b, a <= b.
Teng: a == b, esda tutingki, qo'shaloq tenglik belgisi == tenglik testini bildiradi, bitta a = b esa topshiriqni bildiradi.
Teng emas: matematikada yozuv ≠ , lekin JavaScript-da u != b shaklida yozilgan.
Katta/kichik yoki teng: a >= b, a <= b.
Teng: a == b, esda tutingki, qo'shaloq tenglik belgisi == tenglik testini bildiradi, bitta a = b esa topshiriqni bildiradi.
Teng emas: matematikada yozuv ≠ , lekin JavaScript-da u != b shaklida yozilgan.
Forwarded from coding with ☕️
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!' );
}Forwarded from coding with ☕️
There are four logical operators in JavaScript: || (OR), && (AND), ! (NOT), ?? (Nullish Coalescing). Here we cover the first three, the ?? operator is in the next article.
Forwarded from coding with ☕️
let hour = 12;
let minute = 30;
if (hour == 12 && minute == 30) {
alert( 'The time is 12:30' );
}
Forwarded from coding with ☕️
coding with ☕️
let hour = 12; let minute = 30; if (hour == 12 && minute == 30) { alert( 'The time is 12:30' ); }
Logical Opertors
Forwarded from coding with ☕️
let i = 0;
while (i < 3) { // shows 0, then 1, then 2
alert( i );
i++;
}
Forwarded from coding with ☕️
coding with ☕️
let i = 0; while (i < 3) { // shows 0, then 1, then 2 alert( i ); i++; }
While LOOP
Forwarded from coding with ☕️
switch berilgan qiymatni case lar bilan taqqoslaydi.
case lar qatorma-qator tekshiriladi va mos kelgan birinchi case bajariladi.
break operatori switch blokini to'xtatadi.
Agar hech qaysi case mos kelmasa, default bajariladi.
Forwarded from coding with ☕️
let func = function(arg1, arg2, ..., argN) {
return expression;
};Forwarded from coding with ☕️
coding with ☕️
Function Declaration (An'anaviy Funksiya)
function sayHello() {
console.log("Hello!");
}
sayHello(); // "Hello!"