convert.js

来自「这是《JavaScript学习源代码》一书的源代码」· JavaScript 代码 · 共 16 行

JS
16
字号
// create an integer variable and add another integer
var num = 9;
var nostr = num + 9;

// create a string version of the num integer variable
// then concatenate a second value to it
var adstr= num.toString() + 9;

// create a new Image object
var img = new Image();

// display string values of the variables
var res = "No strings : " + nostr;
res += "\nAdded strings : " + adstr;
res += "\nImage : " + img.toString();
alert(res);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?