首页 > 解决方案 > Javascript 地图问题。Evaluate() 中的并行参数

问题描述

下面是我目前拥有的代码,它评估一个函数,将 tValues 的范围插入函数中的“t”。我还想为“r”插入 rValues

const rValues = Array.from({length: tValues.length}, () => Math.floor(Math.random() * tValues.length));

const xValues = tValues.map(function (x) {return x1.evaluate({t: x})})```

essentially I need something like "function(x,y) {return x1.evaluate({t:x,r:y})}"
but I know that map doesn't do this that way.

标签: javascriptdictionary

解决方案


推荐阅读