Using the Function Object
<HTML> <HEAD> <TITLE>Using the Function Object</TITLE> <BODY><H1> <SCRIPT LANGUAGE="JavaScript"><!-- addBraces = new Function("s","return '['+s+']'") document.write(addBraces("This")) document.write(addBraces("is")) document.write(addBraces("a")) document.write(addBraces("test.")) // --></SCRIPT> </H1></BODY> </HTML>