"I like chocolate cake."
Translation:Me gusta el pastel de chocolate.
Why do you need the article "el" in front of pastel. Why can't I just say: "Me gusta pastel de chocolate"
You're talking about all chocolate cake in general, and it's the subject of the sentence (Chocolate cake is pleasing to me.), so the article is needed.
It'll be used before nouns after gusta/n. Me gusta el español. (I like Spanish.) Me gustan los perros. (I like dogs.) No te gustan los exámenes. (You don't like exams.) No nos gusta la ensalada. (We don't like salad.)
Seems like if you're talking about a specific cake, you'd use the article (me gusta el pastel/the cake is pleasing to me), but if you're talking about cake in general then you wouldn't use the article (me gusta pastel/cake is pleasing to me)?
In Spanish, the definite article is used with nouns in a general sense and with nouns in a specific sense. Out of context, it will be ambiguous.
Thanks, Marcy. Also, here's an explanation of article usage with examples: https://www.spanishdict.com/guide/using-the-definite-article-in-spanish