Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript every function

<script>
    // JavaScript code for every() method
    function isodd(element, index, array) {
        return element % 2 == 1;
    }
 
    function func() {
        var arr = [56, 91, 18, 88, 12];
 
        // Check for odd number
        var value = arr.every(isodd);
        document.write(value);
    }
    func();
</script>
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #javascript #function
ADD COMMENT
Topic
Name
3+8 =