Metawaa Metawaa - 10 months ago 58
jQuery Question

Item in object has two value need the second value jquery

I have an object that has two value "384-768" how can I get the second value for all of the Items. if the item has two value get the highest one if its only one return that one only. how do I get that from the object?

Answer Source

You can get second value using split (it splits strings to array by separating the string with passed argument)


and find in loop maximal element (after converting to integer with parseInt)