Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

clean code javascript

//Not clean code 
const array = ["Fahad", "Khan", "Babar"];
for(let i=0; i < array.length; i++){
	console.log(array[i]);
}

//Clean code 
const array = ["Fahad", "Khan", "Babar"];
array.forEach((item,index) => console.log(index, item))
Comment

PREVIOUS NEXT
Code Example
Javascript :: use of this keyword in js 
Javascript :: repeat js 
Javascript :: how to use fetch in gatsby 
Javascript :: html get input box value by element id 
Javascript :: bin to bit string javascript 
Javascript :: javascript integer to binary 
Javascript :: react routes multiple compoenents 
Javascript :: javascript copy object 
Javascript :: datatable add filter dropdown 
Javascript :: jquery form validation 
Javascript :: concat 
Javascript :: exec in node js 
Javascript :: template literals 
Javascript :: react testing library 
Javascript :: angular npx 
Javascript :: export function javascript 
Javascript :: check contect type axios response 
Javascript :: js how to have an onclick inside of another onClick 
Javascript :: Getting Error “cannot read property split of null” 
Javascript :: cm to inches 
Javascript :: uncaught exception javascript 
Javascript :: create 2d array in javascript filled with 0 
Javascript :: countdown recursion javascript 
Javascript :: match characters in curly braces regex js 
Javascript :: Rounding off to desired no of digit after decimal 
Javascript :: let a = {y;10}; 
Javascript :: .reduce javascript 
Javascript :: feet to km js 
Javascript :: How to Check for an Empty String in JavaScript with the length Property 
Javascript :: convert string to regular expression js 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =