Last active
October 22, 2017 22:35
-
-
Save jeyziel/4f946ba48e592eceeb3622e40198ef03 to your computer and use it in GitHub Desktop.
filtrar apenas os números que sejam resultado de uma raíz quadrada onde o radicando seja maior que 20
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 pow = ( y ) => ( x ) => Math.pow( x, y ) | |
const square = pow(2) | |
const isGreatThan = ( y ) => ( x ) => x > y | |
const isGreatThan20 = isGreatThan(20) | |
const RadicandoGreatThan20 = ( value ) => isGreatThan20( square( value ) ) | |
const list = [1,2,3,4,5,6,7,8,9,10] | |
const listFilter = list.filter( RadicandoGreatThan20 ) | |
console.log( listFilter ) //5,6,7,8,9,10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment