Prep the pan and oven: Heat the oven to 350°F (175°C). Line a 9x13-inch baking pan with parchment, leaving overhang for easy lifting.
Lightly grease the parchment.
Mix the wet ingredients: In a large bowl, whisk the melted butter, brown sugar, and granulated sugar until smooth and glossy. Add the eggs and vanilla. Whisk until well combined.
Combine the dry ingredients: In a separate bowl, whisk the flour, baking soda, baking powder, and salt.
This helps distribute the leaveners evenly.
Bring it together: Add the dry ingredients to the wet. Stir with a spatula until just combined. Avoid overmixing to keep the bars tender.
Add the goodies: Fold in the chocolate chips and about 1 cup of the M&Ms, reserving the rest for the top.
Spread the dough: Transfer the dough to the prepared pan.
It will be thick. Press it evenly into the corners with a spatula or damp hands.
Top and bake: Sprinkle the remaining M&Ms over the surface and gently press them in. Bake for 22–28 minutes, until the edges are golden and the center looks set but still soft.
A toothpick should come out with moist crumbs, not wet batter.
Cool and finish: Set the pan on a rack and cool for at least 30 minutes. If you like, sprinkle a pinch of flaky sea salt over the warm bars to balance the sweetness.
Slice and serve: Lift the slab out with the parchment and cut into squares or rectangles. For the cleanest cuts, let them cool fully or chill briefly.