JSFiddle - React, Tailwind, and code Playground

JavaScript

function nsort(a,b){
    return a - b;
}
var test = [-42, 0, 8, 3, 15, 12],
    max  = test.sort(nsort).pop(); // 15

alert(max);