Front end darsliklari moduli html, css, javascript
Download 105.45 Kb.
|
FRONT END full notes (7) (2022 05 08 17 42 47 UTC)
- Bu sahifa navigatsiya:
- 2. GitHub termins: master, push, pull, MR, clone -------------------------------------------------------------------------------------------- JAVASCRIPT
8. CSS – Media query
@media screen and (min-width: 480px) { body { background-color: lightgreen; } } /* When the width is between 600px and 900px OR above 1100px - change the appearance of */
@media screen and (max-width: 900px) and (min-width: 600px), (min-width: 1100px) { div.example { font-size: 50px; padding: 50px; border: 8px solid black; background: yellow; } } 9. INTRODUCE WITH A PROJECT GitHub -------------------------------------------------------------------------------------------- GitHub setup environment, creating account, install gitbash, setups Nodejs git gitbash 2. GitHub termins: master, push, pull, MR, clone -------------------------------------------------------------------------------------------- JAVASCRIPT -------------------------------------------------------------------------------------------- 1. JAVASCRIPT – INTRODUCTION - DATA TYPES • Javascript • JavaScript compile qilishning yolları (in html, node console, online js compiler) • data types (number, str, boolean, undefined, null, array, obj, function) general intro; • O’zgaruvchilar (var, const, let) • Numbers ni chuqur tanishtirish (ES6 dagi ozgarishlarni ham) +, -, /, *, ++, —, %, float, -=, +=, *=, /=, string as a number let x = "10"; let y = "20"; let z = x + y; // z will be 1020 (a string) concatenate Infinity (or -Infinity) is the value JavaScript will return if you calculate a number outside the largest possible number. let x = 2 / 0; // x will be Infinity let y = -2 / 0; // y will be -Infinity By default, JavaScript displays numbers as base 10 decimals. But you can use the toString() method to output numbers from base 2 to base 36. Hexadecimal is base 16. Decimal is base 10. Octal is base 8. Binary is base 2. let myNumber = 32; myNumber.toString(); // returns “32” myNumber.toString(32); // returns 10 myNumber.toString(16); // returns 20 myNumber.toString(8); // returns 40 myNumber.toString(2); // returns 100000 let x = 500; let y = new Number(500); // (x === y) is false because x and y have different types // objs cant be compared Number.isInteger(), Number.parseFloat(), Number.parseInt(), num.toFixed() Number(true); // returns 1 Number(false); // returns 0 Number("10"); // returns 10 Number(" 10"); // returns 10 Number("10 "); // returns 10 Number(" 10 "); // returns 10 Number("10.33"); // returns 10.33 Number("10,33"); // returns NaN Number("10 33"); // returns NaN Number("John"); // returns NaN Number.isInteger(123) //true Number.isInteger(-123) //true Number.isInteger(5-2) //true Number.isInteger(0) //true var a = parseFloat("10") //10 var b = parseFloat("10.00") // 10 var c = parseFloat("10.33") // 10.33 var d = parseFloat("34 45 66") // 34 var e = parseFloat(" 60 ") // 60 var f = parseFloat("40 years") // 40 var g = parseFloat("He was 40") // NaN Number.parseInt(x, base); // base 2, 10 16 Number.parseInt(string) Number.parseInt(string, radix) var num = 55,6789; var n = num.toFixed(2); // 55,67 • NaN qiymati NaN is a JavaScript reserved word indicating that a number is not a legal number. Trying to do arithmetic with a non-numeric string will result in NaN (Not a Number): let x = 100 / "Apple"; // x will be NaN (Not a Number) let x = 100 + "10"; '10010’ // x will be 10 let x = 100 / "Apple"; isNaN(x); // returns true because x is Not a Number Download 105.45 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling