Get Array Length in Vue JS | Get Object Length in Vue JS

August 15, 2019 | Category : Vue.js

Two days ago my developer was working with array in vue js and he need to get length of array. he was new with javascript then he told me for help. i create simple example of get array length in vue js and get object length in vue js, so understood very well that thing.

I give you bellow very simple example so you can understand how to getting array length or object length in vue js code.

My Example:

<!DOCTYPE html>



<title>Vue JS Get Array Length Or Object Length Example -</title>

<script src=""></script>



<div id="app">

<ul id="exampleApp">

<li v-if="myArray.length">Object Length = {{ myArray.length }}</li>

<li v-for="value in myArray">

{{ value.category }}




<script type="text/javascript">

var app = new Vue({

el: '#app',

data: {

myArray: [

{ category: 'Laravel' },

{ category: 'PHP' },

{ category: 'Codeigniter' }








Object Length = 3




I hope it can help you...