Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Using the forEach function In JavaScript

 
		  let text = "";
function add()
		  { 
			  var node = Node.prototype;
			 nodeList =  NodeList.prototype;
			 const xxx = ["q", "w", "e", "r", "t"];
			 xxx.forEach(change);
			 console.log(xxx);
			 console.log(text);
             /*notice the array does not change but text does*/
	 }
	 function change(item, index) {
		 text += item+index;
	 }
Source by www.checklyhq.com #
 
PREVIOUS NEXT
Tagged: #Using #forEach #function #In #JavaScript
ADD COMMENT
Topic
Name
6+4 =