JSFiddle - React, Tailwind, and code Playground
HTML
<p id="output"></p>
JavaScript
function max(x, y){
return x > y ? x : y;
}
function _max(x){
return function(y){
return x > y ? x : y;
}
}
var brightness = [0.2, -0.3, 1.0, -0.5];
brightness = brightness.map(_max(0));
document.getElementById('output').textContent = brightness.toString();