True, but what does "writing code" mean? If it means learning some basic JavaScript syntax and writing a small text adventure, that isn't hard at all. Learning the mathematical fundamentals of CS on the other hand is a great deal harder, and getting up to speed with what technologies are considered standard is extremely difficult.
Many, if not most, software jobs require very little CS knowledge. At such jobs the ability to compare numbers and read a chart (a matrix of algorithms and data structures vs. time vs. space complexity) will cover almost every possible use case.
"Mid-level development as a skilled trade" jobs, for example.
Right. Most programming jobs aren't asking for 5+ years experience in <some language/framework/library> because they're looking for someone who knows how to balance a red-black tree, they're looking for someone who already knows all the workarounds and kludges you'll need to know to do the work they want you to do.
Learning a programming language is relatively easy. Knowing which of several libraries that offer similar features is the right one for your particular task takes time.