代码示例:(标识:eg_js_variables_add_string_number)
<!DOCTYPE html>
<html>
<body>

<h1>JavaScript 变量</h1>

<p>相加 "8" + 3 + 5 的结果是:</p>

<p id="demo"></p>

<script>
x = "8" + 3 + 5;
document.getElementById("demo").innerHTML = x;
</script>

</body>
</html>
运行结果: