#5 Max Array Value

If you have an array:

You can get the maximum value with a computed property

The maxNumber property will always have the maximum value in the array and will auto re-compute and update any bindings automatically.
Here is some sample code:


You can get the minimum with

See more at http://emberjs.com/api/classes/Ember.computed.html

Also published on Medium.

Published by

Emad Ibrahim

Author of asp .net MVC & TDD, entrepreneur, passionate technologist, programmer and productivity nut. more at http://t.co/oSJXPvzu