I have an update method that should update an item in array:
function update(array) {
return array.map(item => {
// item or primitive?
})
}
What is the best way (in terms of reliability and performance) to distinguish if it's an array of objects or primitive values?