Discuss / JavaScript / just test

just test

Topic source

caylof

#1 Created at ... [Delete] [Delete and Lock User]
function string2int(s) {
    return s.split('').map(function(i) {
        return i * 1
    }).reduce(function(x, y) {
        return x * 10 + y
    })
}


function normalize(arr) {
    return arr.map(function(val) {
        return [
            val.slice(0, 1).toUpperCase(),
            val.slice(1).toLowerCase()
        ].join('')
    })
}

  • 1

Reply