'how to transfer arrov function syntax to regular syntax, without any shorthands
I am new to programming
let options = [ { type: 'vegetable', name: 'carrot', calory: 41 }, { type: 'food', name: '1 baked-egg', calory: 250 } //this below line of code is working const highCalory = options.filter(n => n.calory > 190)
problem is, I cannot translate the above arrow function syntax to regular syntax by trying below code:
const highCaloryB = options.filter(function (getCalory) {
if (options['calory'] > 180) {
return ${getCalory.calory}
}
})
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
