11 lines
286 B
CoffeeScript
11 lines
286 B
CoffeeScript
getMaxSuffix = (array) ->
|
|
max = 0
|
|
return 0 unless array
|
|
array.forEach (element)->
|
|
return unless element
|
|
max = Math.max(match[0], max) if match = String(element).match /\d+$/
|
|
max
|
|
|
|
window.get_max_suffix = getMaxSuffix # make globally available
|
|
export default getMaxSuffix
|