Answers for "js ways to loop array"

48

js loop array

var colors = ["red","blue","green"];
for (var i = 0; i < colors.length; i++) {
    console.log(colors[i]);
}
Posted by: Guest on July-22-2019
0

javascript loop array

class ShoppingList extends React.Component {
  render() {
    return (
      <div className="shopping-list">
        <h1>Shopping List for {this.props.name}</h1>
        <ul>
          <li>Instagram</li>
          <li>WhatsApp</li>
          <li>Oculus</li>
        </ul>
      </div>
    );
  }
}
class shoppingList extends React.Component {
	render () {
    	return (
        	<div ClassName= "shoppoing-list">
            	<h1></h1>
            </div>
        );
    }
}
// Example usage: <ShoppingList name="Mark" />
Posted by: Guest on June-21-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language