how to print variable value in alert in javascript code example Example: javascript alert variable var text = "hello world"; alert(text);