Javascript is a really awful language to use in teaching. The language syntax is not bad, but has no mandatory declarations, which I consider to be a mandatory feature for a good teaching language. In javascript, every typo becomes an error discovered only at runtime. That's bad, but the worst is that the only environment that supports javascript, your browser, is an absolute mess. If I had to pick a readily available language as a teaching tool, I would choose Java. It's flawed too, but at least it is well documented and well behaved. The choice of curriculum is just as important as the choice of language. I would stay away from anything involving graphics, threads, processes, and I/O until the student has definitely got the concepts.