JSFiddle - React, Tailwind, and code Playground
by Chuan Shao
JavaScript
//Use window object's alert() function
window.alert("sample text");
//Simplified alert() usage
alert("sample text");
//Use \n in alert()
alert("The first line\nThe second line");
//Use \t in alert()
alert("Alex\t50\t34\nBob\t59\t38");
//Use variable in alert()
var word = "life";
alert("The magic word is: " + word + ". Don't panic.");
//Try to use parameter in alert(), will fail
var name = "Bob";
var years = 42;
alert("%s is %d years old.", name, years);
//Try to use HTML tags in alert(), will fail
alert("<b>Test Text</b>");