algo asi ?
Código HTML:
Ver original<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> function sumaArrays(array1, array2) {
var array3 = [];
var minLength = Math.min(array1.length, array2.length);
for ( var i = 0; i < minLength; i++) {
array3[i] = array1[i] + array2[i];
}
return array3;
}
var array1 = [ 1, 4, 2, 4, 5 ];
var array2 = [ 5, 6, 7 ];
var array3 = sumaArrays(array1, array2);