I hereby claim:
- I am krzysztofczernek on github.
- I am krzysztofczernek (https://keybase.io/krzysztofczernek) on keybase.
- I have a public key ASA_TRe8xNa-Eb1U6fVmtpeWv4-gRBilIisFVUTfQAq9Lgo
To claim this, I am signing this object:
function add (x, y) { | |
return x + y | |
} |
function coin () { | |
return Math.random() < 0.5 ? 'heads' : 'tails' | |
} |
let firstName = 'krzysztof' | |
function uppercaseName (lastName) { | |
return `${firstName.toUpperCase()} ${lastName.toUpperCase()}` | |
} |
let user = { | |
firstName: 'Krzysztof', | |
age: '26' | |
} | |
function happyBirthday () { | |
user.age = user.age + 1 | |
} |
function calculatePrice (unitPrice, noOfUnits, couponValue = 0) { | |
return unitPrice * noOfUnits - couponValue; | |
} |
function add (a, b) { | |
return a + b | |
} | |
function multiply (a, b) { | |
return a * b | |
} | |
const operations = { // here we're using add and multiply as regular values | |
add, |
const numbers = [1, 1, 2, 3, 5, 8] | |
const transformFunction = x => x + 2 | |
numbers.map(transformFunction) |
function makeGreeter (greeting) { | |
return function greet (name) { | |
return `${greeting}, ${name}!` | |
} | |
} | |
// or, using the ES6 syntax: | |
const makeGreeter = greeting => name => `${greeting}, ${name}!` |
I hereby claim:
To claim this, I am signing this object:
let firstName = 'krzysztof' | |
function uppercaseName (lastName) { | |
return `${firstName.toUpperCase()} ${lastName.toUpperCase()}` | |
} | |
console.log(uppercaseName('doe')) // Prints "KRZYSZTOF DOE" | |
// Lots and lots of code... |