import React from 'react';
import { Router } from 'react-router-dom';
import { createMemoryHistory } from 'history';
import { render } from '@testing-library/react';
const renderWithRouter = (component) => {
const history = createMemoryHistory();
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" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Using the URL object</title> | |
| <style> | |
| figure img { | |
| max-width: 300px; | |
| height: auto; |
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" /> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Request Headers</title> | |
| <style> | |
| html { | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, |
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" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Lexical Scope and `this`</title> | |
| </head> | |
| <body> | |
| <header> | |
| <h1>What the Lexical is <code>this</code>?</h1> |
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
| [{ | |
| "id":123, | |
| "title":"Bell", | |
| "desc":"Lorem ipsum dolor sit amet, consectetur adipisicing elit.", | |
| "img":"bell-lg.png", | |
| "price":12.34 | |
| },{ | |
| "id":456, | |
| "title":"Bullhorn", | |
| "desc":"Quisquam, veritatis, officia. Veritatis, saepe!", |
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>Shopping Cart</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
| Hey there! | |
| Guten Tag. | |
| Hur mår du? |
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" /> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
| <title>Promise.finally</title> | |
| <style> | |
| html { | |
| font-size: 20px; | |
| font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, |
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
| const isMoreThan5 = number => number > 5 | |
| const numbers = [ 2, 4, 8, 9 ] | |
| const result = filter(isMoreThan5, numbers) | |
| const addThree = number => number + 3 | |
| const result = map(addThree, numbers) | |
| result | |
| function map(transform, array) { | |
| const initialArray = [] | |
| const mapReducer = (mappedArray, currentItem) => |