English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
As shown below:
function setName(obj) { obj.ok = "ccccccc"; } function aa() { var name = new String("hechangmin"); name.ok = "sdf"; //The first method // String.prototype.ok = "aaaaa"; //The second method alert(name.ok); // aaaaa setName(name); alert(name.ok); // ccccccc }
The two ways of js string reference mentioned above (must read) are all the content shared by the editor, hoping to provide a reference for everyone, and also hope that everyone will support the Shouting Tutorial more.