I'm a newbie with JavaScript and want to use JSFiddle to start simple and assign a string and print it. When I add the string assignment, it stops printing the hello world part.
Fiddle with string. Eventually I want to import dayjs and format with dayjs to do some testing (can I do that in jsfiddle). Why is the string assignment making the output go away? This is my first time sharing a jsfiddle, so I'll share what's in it as well.
Fiddle includes:
Javascript:
function out()
{
var args = Array.prototype.slice.call(arguments, 0);
document.getElementById('output').innerHTML += args.join(" ") + "\n";
}
var stringDate = “23-SEP-2021 00:00”;
out("Hello world!");
out("Your lottery numbers are:", Math.random(), 999, Math.PI);
out("Today is", new Date());
html:
<pre id="output"></pre>