Poetic Coding Lesson 3

詩意編碼第三堂

Creating Star Patterns with JavaScript
使用Javascript程式創建星形圖案

Date: February 22, 2021

JavaScript

  1. <script> </script>
    <script>
    tag is used to embed a JavaScript in a HTML document. 籤用於在HTML文檔中插入一個JavaScript程式

  2. Printing a number 輸出數字
    document.write(10)
  3. Calculating a number 計算數字
    document.write(10*10)
  4. Printing a text string 輸出串字
    document.write(“10*10”)
  5. What is a variable? 甚麼是可變因素?
    A variable is a container for storing data values.
    In other words, it’s a number that changes its value.
    可變因素是一個存儲數值的容器
    也就是說,它是一個可以改變其數值的數字

    var x=3;
    
    var y=4;
    document.write(x*y);


Back to index