C is a good language to understand the basics of programming -- variables, looping, function -- found in higher-level languages, while introducing you to lower-level concepts -- memory management, pointers, working with a compiler -- that's found not just in C but Rust, C++ and Go.
Tackling C first will make learning JavaScript a breeze because it's based on C.