function populateList(arr) {	
		const menuList = document.querySelector('.js-list');

		arr.forEach(function(item) {
			const link = document.createElement('a');
			const linkItem = document.createElement('li');
			const removeBtn = document.createElement('button');
		
			link.innerHTML = item.name;
			link.className = 'js-link-item'
			removeBtn.className = 'secondary-btn --link js-btn--remove';
			removeBtn.innerHTML = 'x';

			linkItem.appendChild(link);
			linkItem.appendChild(removeBtn);
			menuList.appendChild(linkItem);
		});
	}
// Create HTML list items from array and inject into DOM
Create HTML list items from array and inject into DOM
Create HTML list items from array and inject into DOM
function populateList(arr) {	
		const menuList = document.querySelector('.js-list');
		arr.forEach(function(item) {
			const link = document.createElement('a');
			const linkItem = document.createElement('li');
			const removeBtn = document.createElement('button');
			link.innerHTML = item.name;
			link.className = 'js-link-item'
			removeBtn.className = 'secondary-btn --link js-btn--remove';
			removeBtn.innerHTML = 'x';
			linkItem.appendChild(link);
			linkItem.appendChild(removeBtn);
			menuList.appendChild(linkItem);
		});
	}
function populateList ( arr ) { const menuList = document . querySelector ( '.js-list' ) ; arr . forEach ( function ( item ) { const link = document . createElement ( 'a' ) ; const linkItem = document . createElement ( 'li' ) ; const removeBtn = document . createElement ( 'button' ) ; link . innerHTML = item . name ; link . className = 'js-link-item' removeBtn . className = 'secondary-btn --link js-btn--remove' ; removeBtn . innerHTML = 'x' ; linkItem . appendChild ( link ) ; linkItem . appendChild ( removeBtn ) ; menuList . appendChild ( linkItem ) ; } ) ; }
Create HTML list items from array and inject into DOM
Create HTML list items from array and inject into DOM