'use strict';
var transform = function transform(value, predicate, mutator) {
if (predicate(value)) {
return mutator(value);
}
return value;
};
var height = 69;
var isHeightInches = function isHeightInches(height) {
return height < 100;
};
var inchesToCentimeters = function inchesToCentimeters(inches) {
return height * 2.54;
};
height = transform(height, isHeightInches, inchesToCentimeters);
console.log(height);
height = transform(height, isHeightInches, inchesToCentimeters);
console.log(height);
Last active
October 5, 2015 20:30
-
-
Save gaand/65302e9a2227b74d2ee3 to your computer and use it in GitHub Desktop.
Transomation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment