Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-git.js"></script>
<meta name="description" content="jQueryPlugin" />
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
</body>
</html>
 
(function($) {
    $.suma = function(array) {
        var total = 0;
        $.each(array, function (indice, valor) {
            valor = $.trim(valor);
            valor = parseFloat(valor) || 0;
            total += valor; 
        });
        return total;
    };
})(jQuery);
var resultado = $.suma([1,2,3,4]);  // 10
Output 300px

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
aitormedran0pro
0viewers