This file contains 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"> | |
<meta name="viewport" | |
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>On Load</title> | |
</head> | |
<body> |
This file contains 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
import {useState} from 'react'; | |
const App = () => { | |
const [counter, setCounter] = useState(0); | |
const incrementHandler = () => setCounter(counter + 1); | |
const decrementHandler = () => setCounter(counter - 1); | |
return ( | |
<> |
This file contains 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> | |
<head> | |
<style> | |
body { | |
font-family: sans-serif; | |
} | |
h1 { | |
color: #2f4f4f; | |
font-weight: normal; |
This file contains 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
// axios example | |
const axios = require('axios').default; | |
// Make a request for a user with a given ID | |
let employeePromise = axios.get('https://fakejsonapi.com/fake-api/employee/api/v1/employees'); | |
let onfulfilled = function(response) { | |
// handle success | |
console.log(response.data.data[0]); | |
}; |
This file contains 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
Strict mode is an ES5 addition to JavaScript that changes the behavior of JavaScript engines so that errors are thrown instead of silently picked up. | |
The behavior of some language features is changed, and some unsafe language features are even completely banned. | |
One of the things that strict mode changes is that it disables arguments aliasing. |
This file contains 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> | |
<head> | |
<title>Page Title</title> | |
<style> | |
.photoContainer { | |
margin: 10px | |
} | |
</style> | |
</head> |
This file contains 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> | |
<head> | |
<meta http-equiv="Content-Security-Policy" content="default-src 'unsafe-inline' *.flickr.com *.staticflickr.com"> | |
<title>Page Title</title> | |
<style> | |
.photoContainer { | |
margin: 10px | |
} | |
</style> |