JSFiddle - React, Tailwind, and code Playground

by mendesjuan

HTML

<span>Hello</span>
<span>Hello</span>
<span>Hello</span>
<span>Hello</span>

JavaScript

function addjQValues($jq, getter) {
    return Array.prototype.reduce.call( $jq, function (a, b) {
        return a+ getter.call($(b));
    }, 0);  
}
console.log(
    addjQValues($('span'), $.fn.height)
);