"Appending Variables to Strings" grammar error

Instead of var someAdjective, it should be var someAdverb, since the word is modifying a verb instead of a noun.

All this coding has really brought out the grammar nazi in me. But it should be adverb, not adjective? Maybe I’m totally wrong.

Best,

Jim

The subject is “Learning to code”, which is a noun phrase with a gerund (gerunds are basically verbs that function as nouns, formed by adding “-ing”).

So it’s looking for some sort of adjective (“great”, “interesting”, “challenging”), rather than an adverb (“very”, “interestingly”, “quickly”).

var someAdjective;
var myStr = "Learning to code is ";

The verb in question is a gerund being used as a noun. ‘Learning to code’ in this case is replaceable with ‘The experience of learning to code’, which is a noun.

Let’s plug in an adjective and adverb. ‘Easy’ is an adjective and ‘easily’ is an adverb.

Learning to code is easy.
makes more sense than
Learning to code is easily.

As a verb, ‘learning’ can be modified by an adverb, but in the end it will be modified by a predicative adjective.

Learning to code quickly(adverb) is not easy(adjective).

Ahh I see. I understand now.

Yes, the verb “to be” is a copula verb which links subject and predicate. Copulae always take nouns or adjectives, never adverbs. This is a mistake of over-correction that people often make. So, you say “I am good”, not “I am well” (Unless you are trying to say that you aren’t sick) for the same reason that you would say “I am hungry” and not “I am hungrily”.