Javascript get array size

Javascript length method

<button onclick="getSize()">Get array size</button>
<script>
function getSize() {
    var arr = ["Apple", "Banana", "Mango", "Orange", "Papaya"];
    
    alert(arr.length);
}
</script>

Related Sourcecode

More Sourcecode

×
Google login
SignUp with Email
X