Preheat oven to 350 F.
In a stand mixer or mixing bowl, beat the butter and sugars together. Then add the vanilla and 1 egg and beat together. Then add the other egg and beat together.
In a separate bowl, add the flour, baking soda and salt and gently combine/whisk together. Add the dry ingredients mix 1 cup at a time to the wet ingredients. Beat until the dough forms.
Gently stir in the chocolate chips. Chill the dough for at least 1 hour.
Then take 2-3 cookies worth of dough and roll into a "log" and then bend into the shape of rainbow. Press down until it looks like the photo.
Add the M&Ms, as close together as possible. They will spread out some as the dough underneath thins as it bakes.
Bake in the preheated oven for 9 to 11 minutes, or until cookie is cooked through.
Let cool on cooling rack before serving.