JavaScript - Beg to Adv - Objects Question 2

Last Updated :
Discuss
Comments

Which of the following is a valid way to define a function as a property of an object?

obj.func = function() { ... }

obj.func = () => { ... }

Both

None of the above

Share your thoughts in the comments