π€ Chapter 9: λλ€ λΌμ΄λΈλ¬λ¦¬
- μμΈν λ΄μ©μ μ± μ μ°Έκ³ ν©μλΉ (P.199 ~ P.258)
π¦ λλ€ κΈ°λ³Έ μ¬μ©λ²β
π R.range ν¨μβ
import * as R from 'ramda';
console.log(R.range(1, 9 + 1)); // [1, 2, 3, 4, 5, 6, 7, 8, 9]
π R.tap λλ²κΉ μ© ν¨μβ
R.tap
ν¨μλ 2μ°¨ κ³ μ°¨ ν¨μ ννλ‘ νμ¬ κ°μ νμ ν μ μκ² ν΄μ€λ€.
import * as R from 'ramda';
const numbers: number[] = R.range(1, 9 + 1);
R.tap(n => console.log(n))(numbers); // [1, 2, 3, 4, 5, 6, 7, 8, 9]
π R.pipe ν¨μβ
import * as R from 'ramda';
const array: number[] = R.range(1, 10);
R.pipe(R.tap(n => console.log(n)))(array); // [1, 2, 3, 4, 5, 6, 7, 8, 9]