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 outerValue = 'samurai'; | |
let later; | |
function outerFunction() { | |
const innerValue = 'ninja'; | |
function innerFunction() { | |
console.log(outerValue === 'samurai', 'I can see the samurai.'); | |
console.log(innerValue === 'ninja', 'I can see the ninja.'); | |
} |
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 text = 'Hello text!'; | |
console.log('Before defining functions'); | |
const useless = (callback) => { | |
console.log('In useless function'); | |
return callback(); | |
} | |
const getText = () => { | |
console.log('In getText function'); |
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
.first-example { | |
@include fade(show); | |
&--hide { | |
@include fade(hide); | |
} | |
} | |
.second-example { | |
@include fade(show); |
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
@mixin flex-column { | |
display: flex; | |
flex-direction: column; | |
} | |
@mixin flex-center { | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} |
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
@function calculateRem($size) { | |
$remSize: $size / 16px; | |
@return $remSize * 1rem; | |
} | |
@mixin font-size($size) { | |
font-size: $size; | |
font-size: calculateRem($size); | |
} |
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
.only-extra-small { | |
@include show-only-extra-small; | |
} | |
.only-medium-up { | |
@include show-medium-up; | |
} | |
.only-small-up { | |
@include show-small-up; |
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 singleton = (() => { | |
// Instance stores a reference to the Singleton | |
let instance; | |
const init = () => { | |
// Private methods and variables | |
const privateMethod = () => { | |
console.log('Private function'); | |
}; | |
const privateVariable = 'Private variable'; |
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 person = { | |
'first-name': 'Tamas', | |
'last-name': 'Munkacsi' | |
}; | |
const { 'first-name': firstName, 'last-name': lastName } = person; | |
console.log(firstName, lastName); |
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
<div class="card"> | |
<div class="card__value"> | |
Original | |
</div> | |
</div> | |
<div class="card card--large"> | |
<div class="card__value"> | |
Large | |
</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
const mockUsers = [ | |
{ | |
id: 1, | |
name: 'Tom', | |
deviceId: 102 | |
}, | |
{ | |
id: 2, | |
name: 'Michael', | |
deviceId: 101 |