Estoy usando la función Math.max para procesar una matriz usando la función de propagación, pero sigo recibiendo un error de NaN. Cualquier ayuda en este asunto sería muy apreciada.
import finnhub from 'https://cdn.skypack.dev/finnhub'; const api_key = finnhub.ApiClient.instance.authentications['api_key']; api_key.apiKey = "c5cam0iad3ib55bb0ajg" const finnhubClient = new finnhub.DefaultApi() let stockTicker = prompt("Please enter the symbol of the stock to chart:"); //Finance API Function Call Below finnhubClient.stockCandles(stockTicker, "D", ((Math.trunc(Date.now() / 1000)) - 8640000), Date.now(), (error, data, response) => { let dataSetDayHigh = [] let dataSetDayRange = 1 for (dataSetDayRange = 1; dataSetDayRange < 41; dataSetDayRange = dataSetDayRange + 1){ dataSetDayHigh[dataSetDayRange] = Math.trunc(data.h[dataSetDayRange]) } let yAxisRangeUpper = Math.max.apply(null, dataSetDayHigh) console.log("Data Set Day High Values = " + yAxisRangeUpper)