This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let num = 0; | |
async function increment() { | |
num += await 2; | |
console.log(num); | |
} | |
increment(); | |
num += 1; | |
console.log(num); | |
/**** | |
* What is the resulting output? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//version 1 | |
let a1 = Array.from({ | |
length: 5 | |
}, n => Math.random()); | |
console.log('1', a1); | |
//version 2 | |
let a2 = new Array(5).fill(1).map(n => Math.random()); | |
console.log('2', a2); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* 0 or more matches | |
+ 1 or more matches | |
? 0 or 1 match | |
^ matches the start of the string or line | |
$ matches the end of the string or line | |
\ signifies an escape sequence | |
. matches any single character except newline | |
( ) capturing group. Save to reuse later | |
| used as a logic OR inside a capturing group | |
[abc] character set. Matches one of the things in the brackets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Right-Click Menus</title> | |
<meta name="viewport" content="width=device-width"> | |
<style> | |
*{ | |
padding: 0; | |
margin: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Unicode Characters in JavaScript | |
// Escape Sequences in JavaScript | |
// http://www.unicode.org/charts/ | |
// String.fromCharCode(num [, num, num]) | |
// myString.charCodeAt(index) | |
// \u0434 | |
// \0 \' \" \\ \n \r \t | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Arrays of Objects | |
// Efficiently combining and chaining Array methods and Arrow functions | |
// person.email.indexOf("@replicant.io") > -1 | |
//Find the names of all the people who have "replicant.io" emails | |
let people = [ | |
{"id":123, "name":"Rick Deckard", "email":"rick@bladerunner.org"}, | |
{"id":456, "name":"Roy Batty", "email":"roy@replicant.io"}, | |
{"id":789, "name":"J.F. Sebastian", "email":"j.f@tyler.com"}, | |
{"id":258, "name":"Pris", "email":"pris@replicant.io"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DarkSky API | |
// CORS requests are NOT allowed by the DarkSky server | |
// Requests from other Servers are allowed | |
// So, we would make a pass thru file on a server. | |
// Browser sends the fetch( ) AJAX request to OUR server | |
// OUR server sends the AJAX request to DarkSky server | |
// DarkSky responds to OUR Server | |
// OUR Server sends the DarkSky reply back to Browser | |
// Browser AJAX call => Our Server => DarkSky => Our Server => Browser AJAX call |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Mock Server APIs in Postman</title> | |
<meta name="viewport" content="width=device-width"> | |
</head> | |
<body> | |
<header> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Flexbox Getting Started</title> | |
<meta name="viewport" content="width=device-width"> | |
<style> | |
.container{ | |
display: flex; | |
flex-direction: column; |
OlderNewer