I'm just now sure why this isn't working. I've also tried an async/await solution, but in all cases, the variable doesn't have the data assigned to it.
let variable = []
let getProducts = () => {
return fetch(baseUrl + limitUrlModifier + pageUrlModifier + toString(pageNumber) + includeFieldsUrlModifier, getFetchOptions)
.then(response => response.json())
.then(data => variable = data.data)
}
getProducts()