Preheat oven to 190C/170C fan. Line a 13x9 rectangular tin with baking paper.
Mix together flour, cocoa powder, bicarbonate of soda, salt and cornflour. Set aside.
Melt butter in a large bowl in the microwave. Add the sugars to the butter and whisk for 2 minutes or until smooth.
Add the egg and vanilla extract. Whisk until smooth.
Combine with the dry ingredients and whisk until smooth.
Add the majority of the M&Ms. Mix.
Press the mixture into the tin and add the remaining M&Ms to the top.
Bake for 12-15 minutes. The top of the bake should look like a cookie and a skewer should come out clean.
Cool in the tin for 15 minutes. Transfer to a cooling rack. Cut into 16 pieces (or less if you'd like larger pieces).