Demo entry 6754727

a

   

Submitted by anonymous on Jul 20, 2018 at 03:19
Language: JavaScript. Code size: 297 Bytes.

function hasDuplicateValue(array) {
    var existingNumbers = [];
    for(var i = 0; i < array.length; i+ +) {
        if(existingNumbers[array[i]] = = = undefined) {
            existingNumbers[array[i]] = 1;
        } else {
            return true;
        }
    }
    return false;
}

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).