Peel, core and chop apples into small pieces, then place into a medium mixing bowl.
Add lemon juice and stir. Set aside.
In a large mixing bowl, beat sugar, brown sugar, eggs and vanilla together until creamy.
Pour melted butter into mixture and beat until smooth.
In another bowl, whisk flour, baking powder, cinnamon, nutmeg, salt together. Take 1/4 cup of flour mixture and sprinkle on top of apples, stir to coat.
With a spatula, stir flour mixture into sugar mixture and stir until combined, then fold in apples and walnuts.Stir until well coated.
Spoon mixture into prepared baking dish and smooth evenly.