> For the complete documentation index, see [llms.txt](https://information9527.gitbook.io/html/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://information9527.gitbook.io/html/qian-duan-san-xiong-di/js-ji-ben-shi-yong/ji-ben-yu-fa.md).

# 基本語法

## 一、輸出

JS輸出方式，可以使用在除錯部分(debug)。

### \*write&#x20;

```javascript
document.write('Hello JavaScript');
document.write('<h1>Hello JavaScript</h1>');
```

{% hint style="success" %}

### 補充&#x20;

JS輸入字串可以使用雙引號/單引號/重音符號，但是需要成雙對使用。<br>
{% endhint %}

### \*alert  / \*cosole.log

這裡是用上需要注意alert / console.log使用範圍，例如console.log();如果值是跟object 的形式，是可以顯示出來，相反alert 反而是無法查看。

```javascript
alert('彈出訊息');
console.log('彈出訊息');
```

## 二、
