Skip to content

Instantly share code, notes, and snippets.

@MarvinJWendt
Created March 2, 2020 23:57
Show Gist options
  • Save MarvinJWendt/88d55da08fb64da1f7a6223b316eafb8 to your computer and use it in GitHub Desktop.
Save MarvinJWendt/88d55da08fb64da1f7a6223b316eafb8 to your computer and use it in GitHub Desktop.
function is(x) {
return {
plus: (plus) => {
return is(x + plus)
},
minus: (minus) => {
return is(x - minus)
},
equalToTen: () => {
return (x === 10)
}
}
}
console.log(is(5).plus(5).equalToTen()) // true
console.log(is(5).plus(5).plus(1).equalToTen()) // false
console.log(is(10).equalToTen()) // true
console.log(is(11).minus(1).equalToTen()) // true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment