How to use Statement in JavaScript

In this article I am going to explain about Statement in JavaScript.
  • 1898

JavaScript Statement

The statement repeats a group of embedded statements for each element in an array. The statement is used to iterate through the collection to get the information that you want, but can not be used to add or remove items from the source collection to avoid unpredictable side effects.


for(variable in object)


      //Statement that you want to execute





<script type="text/javascript">


        function myFunction() {

            var x;

            var str = "";

            var Emp = { Name: "Raju", Add: "Delhi", age: 30 };


            for (x in Emp) {

            str = str +Emp[x];








<button onclick="myFunction()">Click</button>







Further Readings

You may also want to read these related articles: here
Ask Your Question 
Got a programming related question? You may want to post your question here


More Articles

© 2020 DotNetHeaven. All rights reserved.