GSGaurav Srivastavainfiftybugsofgrey.hashnode.dev·Nov 25, 2023 · 7 min readjavascript.info Notes - ArraysArray initiation let arr = new Array(); //almost rarely used let arr = []; // this is what we do //special case let arr = new Array(10); //creates an array of ten elements length of array let arr = ['a', 'b', 'c']; let length = arr.length; console...00
GSGaurav Srivastavainfiftybugsofgrey.hashnode.dev·Nov 25, 2023 · 2 min readjavascript.info Notes - StringsThree ways to declare strings in JS let single = 'single-quoted'; let double = "double-quoted"; let backticks = `backticks`; Accessing characters let str = `Hello`; // the first character console.log( str[0] ); // H console.log( str.at(0) ); // H ...00
GSGaurav Srivastavainfiftybugsofgrey.hashnode.dev·Nov 23, 2023 · 2 min readjavascript.info Notes - NumbersQuick notes about numbers in Javascript. It is expected that you have already understood how it works and just want to revise the important points. let billion_1 = 1000000000; let billion_2 = 1_000_000_000; let billion_3 = 1e9; //all above are same ...00
GSGaurav Srivastavainfiftybugsofgrey.hashnode.dev·Nov 17, 2023 · 3 min readIntroduction to Typescript - Chapter 5: Type AssertionsType assertions are very useful in Typescript and in some cases very necessary. It is also called Type Casting. There are several situations in which we know more about the data than the compiler and we, as developers, assert that we know more and as...00
GSGaurav Srivastavainfiftybugsofgrey.hashnode.dev·Nov 16, 2023 · 4 min readIntroduction to Typescript - Chapter 4: FunctionsContinuing my journey to understand Typescript, we shall explore functions, but before that let's understand a few things about literal types and type aliases. Type Aliases: So, as the name suggests, it is very common that we need different kinds of ...00