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).