i have an array of objects i need to append the 0 index object to a div and 1 index object to another div. Using switch case returns from the initial case itself not executing the second index
let arr = [{id:1,name:'test'},{id:2,name:'sample'}]
arr.forEach((obj,index) => {
switch(index){
case 0:
$(".first p").text(obj.name)
case 1:
$(".second p").text(obj.name)
}
})
after executing the first case it returns not executing the case 1?
Thanks in advance