/*After a variable has been created, it may be used later in a program
anywhere a value may be used. For example, console.log prints a value,
we can also give console.log a variable.*/
//These two examples have the exact same output.
console.log("Hello, World!");
let message = "Hello, World!";
console.log(message);
import javax.script.ScriptEngineManager;
import javax.script.ScriptEngine;
import javax.script.ScriptException;
public class Test {
public static void main(String[] args) throws ScriptException {
ScriptEngineManager mgr = new ScriptEngineManager();
ScriptEngine engine = mgr.getEngineByName("JavaScript");
String foo = "40+2";
System.out.println(engine.eval(foo));
}
}