View checkout-form.sass
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
/* Block component */ | |
.checkout-form { | |
/* Elements */ | |
&__title { | |
// ... | |
} | |
&__button { | |
// ... | |
} | |
&__input { |
View checkout-form.css
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
/* Block component */ | |
.checkout-form { | |
// .. | |
} | |
/* Element that depends upon the block */ | |
.checkout-form__title { | |
// .. | |
} | |
.checkout-form__input { | |
// .. |
View example.html
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
/* Super simplified html form to illustrate BEM classname usage. */ | |
<form class="checkout-form checkout-form--darkmode"> | |
<p class="checkout-form__title"> | |
Buy Bitcoins! | |
</p> | |
<input class="checkout-form__input checkout-form__input--big"/> | |
View gist:099ee9ae48727229d2b4c652464a4e71
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 React, { Component } from 'react'; | |
import './App.css'; | |
import List from './ToDoList'; | |
export default class App extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
term: '', |
View return_outputs.js
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
console.log(fitPlayers) | |
// Expected output: | |
// [ 'David de Gea', | |
// 'Victor Lindelöf', | |
// 'Paul Pogba', | |
// 'Romelu Lukaku', | |
// 'Axel Tuanzebe', | |
// 'Scott McTominay', | |
// 'Diogo Dalot' ] |
View give_me_non_injured_players.js
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
function returnFitPlayers(allPlayers, injuredPlayers) { | |
let result = allPlayers.filter((player) => { | |
!injuredPlayers.includes(player) | |
}); | |
return result; | |
} | |
// filter through the manUTD team and return players | |
// that are NOT included in the injuredPlayers array | |
const fitPlayers = returnFitPlayers(manUTD, InjuredPlayers) |
View injury_list.js
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
const injuredPlayers = [ | |
"Juan Mata", | |
"Joel Castro Pereira", | |
"Marcos Rojo", | |
"Phil Jones", | |
"Eric Bailly", | |
"Alexis Sánchez", | |
"Anthony Martial", | |
"Cameron Borthwick-Jackson" | |
] |
View manutd_team.js
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
const manUTD = [ | |
"David de Gea", | |
"Victor Lindelöf", | |
"Eric Bailly", | |
"Phil Jones", | |
"Marcos Rojo", | |
"Paul Pogba", | |
"Alexis Sánchez", | |
"Juan Mata", | |
"Romelu Lukaku", |
View remove_the_injured.js
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
const manUTD = [ | |
"David de Gea", | |
"Victor Lindelöf", | |
"Eric Bailly", | |
"Phil Jones", | |
"Marcos Rojo", | |
"Paul Pogba", | |
"Alexis Sánchez", | |
"Juan Mata", | |
"Romelu Lukaku", |
View concat_transformation.js
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
let arr = [1,2,3,4,5] | |
arr.concat(6) | |
console.log(arr) | |
// Expected output: [1,2,3,4,5] | |
let arrClone = arr.concat("I am six") | |
console.log(arrClone) |
NewerOlder