Here's an RTS where you program your units with JavaScript

Screeps: Arena is an RTS all about programming. Quite literally: You don't control anything once the match starts, you just hope that the orders you planned out beforehand are good enough...
Read more.