Get started with ramda CDN
Stable version
Copied!
How to start using ramda CDN
// Import Ramda library
const R = require('https://cdn.cdnhub.io/ramda/0.29.1/ramda.min.js');
// Sample data
const data = [
{ name: 'Alice', age: 25 },
{ name: 'Bob', age: 30 },
{ name: 'Charlie', age: 20 },
];
// Function to filter objects based on age (> 25)
const filterOlder = R.filter(R.propSatisfies(R.over(R.lensProp('age'), R.gt(25))));
// Function to square the age value
const squareAge = R.map(R.over(R.lensProp('age'), R.multiply(R.identity, 2)));
// Apply filtering and mapping in one go
const result = R.pipe(
filterOlder,
squareAge
)(data);
console.log(result); // [{ name: 'Bob', age: 900 }]
Copied!
Copied!
All versions
0.1.0
0.1.1
0.1.2
0.1.4
0.1.5
0.10.0
0.11.0
0.12.0
0.13.0
0.14.0
0.15.0
0.15.1
0.16.0
0.17.0
0.17.1
0.18.0
0.19.0
0.19.1
0.2.0
0.2.1
0.2.2
0.2.3
0.2.4
0.20.0
0.20.1
0.21.0
0.22.0
0.22.1
0.23.0
0.24.0
0.24.1
0.24.1-es.rc1
0.24.1-es.rc2
0.24.1-es.rc3
0.25.0
0.26.0
0.26.1
0.27.0
0.27.1
0.27.2
0.28.0
0.29.0
0.29.1
0.3.0
0.30.0
*** 0.30.1
0.4.0
0.4.1
0.4.2
0.4.3
0.5.0
0.6.0
0.7.0
0.7.1
0.7.2
0.8.0
0.9.0
0.9.1