Talk:Dot product: Difference between revisions

m
Make voices distinguishable
m (Make voices distinguishable)
Line 45:
 
// -> 3
})();</lang> -- --[[User:Hout|Hout]] ([[User talk:Hout|talk]]) 16:56, 27 February 2016 (UTC)
})();</lang>
 
:I'd be inclined to say go for it.
 
:That said, I'd also be inclined to replace zipWith with something like:
 
:<lang javascript> function zipWith(f, xs, ys) {
return xs.length === ys.length ? (
xs.map(function(x, i) {return f(x,ys[i])})
Line 57:
}</lang>
 
:Or, if you feel like <code>zipWith</code> should work with mis-matched argument lengths, give this implementation some other name. ... There is some use for the mismatched approach, but most of the time - including this example - that's just an error.
 
:(I am not really fond of javascript's implementation of .map(), but this kind of thing is what it was designed for.)
 
:And, thanks! --[[User:Rdm|Rdm]] ([[User talk:Rdm|talk]]) 19:36, 27 February 2016 (UTC)
6,962

edits