How to push JavaScript to Arduino board

How do I persist a JavaScript program onto the Arduino board so that it runs by default next time any power source is provided?

I recently purchased the Johnny-Five Inventor's Kit which comes with a Tessel 2. Tessel provides a CLI that allows me to "push" JavaScript to the board as the default application to run when power is supplied. I'm looking to do the same type of thing with Arduino. Is this even possible? Or is it necessary to be connected to the computer via USB to run the JavaScript?

I can upload the "StandardFirmata" sketch to the Arduino which allows me to run JavaScript when connected via USB. But it doesn't persist after exiting the program.

You CANNOT run Javascript on an Arduino.

And in case (as I suspect) you are mixing up Javascript with Java (which is quite different) you CANNOT run Java on an Arduino.

Arduinos are programmed using C++

...R

But it doesn't persist after exiting the program.

"it" is a pronoun with no referent. What doesn't persist? If you loaded StandardFirmata, that sketch WILL be there the next time the Arduino resets. What program are you exiting?

"I can upload the "StandardFirmata" sketch to the Arduino which allows me to run JavaScript when connected via USB."

I doubt that, if there's any javascript running, it happens on the computer/device on the other end of the USB cable, not arduino. And that's why it doesn't "persist" on arduino.

Robin2: You CANNOT run Javascript on an Arduino.

I assume Firmata is not running "JavaScript on an Arduino" but is just a communication protocol which is eventually run as C++ code on the Arduino?

Robin2: And in case (as I suspect) you are mixing up Javascript with Java (which is quite different) you CANNOT run Java on an Arduino.

No I'm not mixing them up.

PaulS: "it" is a pronoun with no referent. What doesn't persist? If you loaded StandardFirmata, that sketch WILL be there the next time the Arduino resets. What program are you exiting?

it = JavaScript code

That's true the "StandardFirmata" sketch will be persisted when the Arduino resets. I've got a node script that connects to the Arduino via firmata protocol that looks something like:

var five = require("johnny-five");
var board = new five.Board();

// The board's pins will not be accessible until
// the board has reported that it is ready
board.on("ready", function() {
  console.log("Ready!");

  var led = new five.Led(13);
  led.blink(2000);
});

I was hoping I could make this JavaScript run without first connecting the Arduino board via USB and running my node script.

no way. What you have there: - standard firmata on arduino that expects commands on serial line from a program that "talks" firmata protocol - a javascript program running on (PC? Android? PI?) that uses a library which implements firmata protocol.

Consider the tessel thing has a quite few MBytes of RAM to fit a node.js in it. Arduino has 32kbytes of program flash and 2kbytes or ram.