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 accounts = [{ | |
| _id: "5e56d5f5c00d45b8f1125ef4", | |
| index: 0, | |
| guid: "955310d3-45df-47e7-bc9c-92504d5e92d2", | |
| isActive: true, | |
| balance: "$3,926", | |
| picture: "http://placehold.it/32x32", | |
| age: 26, | |
| eyeColor: "green", | |
| name: "George Bond", |
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 ex1 = 'The quick brown fox jumped over the lazy dog'; | |
| const ex2 = 'A1B2C3D4E5F6G7H8I9J10'; | |
| const ex3 = 'The salad costs $9.99'; | |
| const ex4 = 'Contact customer support on 0800 300 500'; | |
| const ex5 = 'You can contact me on Twitter @codebubb or james@juniordevelopercentral.com'; | |
| // Exercise 01 | |
| // Using a regex pattern, get the 3 letter words in the ex1 string. | |
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 ex1 = 'Grade 1Grade 2Grade 3Grade 4Grade 5'; | |
| const ex2 = 'The pheasant has no agenda'; | |
| const ex3 = '75, 50 : 123 / 900 - 321 + 900 = 55'; | |
| const ex4 = 'My name is: James'; | |
| const ex5 = `Did you find any droids? No, sir. If there were any on board, they must also have jettisoned. Send a scanning crew on board. I want every part of this ship checked. Yes, sir. I sense something...a presence I haven't felt since... Get me a scanning crew in here on the double. I want every part of this ship checked! Boy, it's lucky you've these compartments. I use them for smuggling. I never thought I'd be smuggling myself in them. This is ridiculous. Even if I could take off, I'd never get past the tractor beam.` | |
| // Exercise 01 | |
| // Using a regex, get an array of the grade values e.g. Grade 1, Grade 2 ... | |
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
| require('file-loader?name=[name].[ext]!./index.html'); | |
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| import { App } from './App'; | |
| import './App.scss'; | |
| const appElement = document.getElementById('app'); | |
| ReactDOM.render(<App />, appElement); |
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
| import React, { useState, useEffect } from 'react'; | |
| export function App() { | |
| return ( | |
| <div className="app-container"> | |
| <h1>Latest YouTube Videos</h1> | |
| </div> | |
| ); | |
| } |
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
| import React, { useState } from 'react'; | |
| export const Search = props => { | |
| const [channelId, setChannelId] = useState(''); | |
| return ( | |
| <div> | |
| <div className="search"> | |
| <input type="text" onChange={event => setChannelId(event.target.value)} placeholder="Enter your favourite channel ID" /> | |
| <button disabled={!channelId.length} onClick={() => props.setCurrentChannelId(channelId)}>Get videos</button> | |
| </div> |
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
| import React, { useState, useEffect } from 'react'; | |
| import { Search } from './Search'; | |
| export function App() { | |
| const [currentChannelId, setCurrentChannelId] = useState(); | |
| return ( | |
| <div className="app-container"> | |
| <h1>Latest YouTube Videos</h1> | |
| <Search setCurrentChannelId={id => setCurrentChannelId(id)}/> |
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
| import React from 'react'; | |
| export const Video = props => ( | |
| <div className="videos__item"> | |
| <div className="video__image"> | |
| <a target="_blank" href={props.video.link}> | |
| <img src={`https://i4.ytimg.com/vi/${props.video.guid.split(':')[2]}/mqdefault.jpg`} /> | |
| </a> | |
| </div> | |
| <div className="video__footer"> |
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
| import React, { useState, useEffect } from 'react'; | |
| import { Search } from './Search'; | |
| import { Video } from './Video'; | |
| export function App() { | |
| const [currentChannelId, setCurrentChannelId] = useState(); | |
| const [videos, setVideos] = useState([]); | |
| const baseUrl = 'https://api.rss2json.com/v1/api.json?rss_url=https%3A%2F%2Fwww.youtube.com%2Ffeeds%2Fvideos.xml%3Fchannel_id%3D'; |
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>ParcelJS</title> | |
| <link rel="stylesheet" href="scss/styles.scss"> | |
| </head> | |
| <body> | |
| <h1>Hello from Parcel!</h1> |