<分区>
你好,我正在尝试使用 Math.min,但结果是 NaN,这是代码。
使用 Math.min 的方法
method() {
var DeltaPrueba = this._markerService.getDeltasRx1();
console.log(DeltaPrueba); // 1
var menor = Math.min(DeltaPrueba);
console.log(menor); //1
}
服务
CalculateDeltas(){
/* do some math to calculate then save in array Deltas*/
Deltas = [DeltaT1,DeltaT2,DeltaT3,DeltaT4,DeltaT1CR,DeltaT2CR,DeltaT3CR,DeltaT4CR] ;
}
getDeltasRx1(){
return Deltas;
}
控制台日志编号 1 显示包含所有 de 数据的数组,如下所示:
[“18.20”、“0.00”、“425.97”、“316.87”、“667.80”、“422.34”、“425.99”、“316.89”]
控制台日志 2 显示 NaN :
NaN