> For the complete documentation index, see [llms.txt](https://dtian.gitbook.io/daily-report-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dtian.gitbook.io/daily-report-1/day-33-7-10.md).

# Day 33 - 7/10

Plan: Wait for confirmation from Ms Ly then move to javascript

Progress:&#x20;

### <mark style="color:blue;">Output:</mark>&#x20;

* `document.getElementById("demo") / document.getElementsByClassName("name")`
* both ' ' and " " are accepted
* `document.getElementById("demo").innerHTML = ;` : to write into an html element
* `document.write(5 + 6);` : to write into html output; if used after html document is loaded will replace every existing html (example: `onclick= "document.write(5 + 6)"` ) (<mark style="color:orange;">note: used only in testing</mark>)
* `alert(5+6);` : alert box to display data
* `console.log(5+6);` : for debugging
* `window.print()` : to open print window

### <mark style="color:blue;">Statements:</mark>

* white spaces are ignored
* max-line width should be 80 characters; best line-break point is after an operator

### <mark style="color:blue;">Syntax (or rules)</mark>

* fixed value called Literals; variable value called Variables
* identifier (or variable names) : start with letter, dollar sign ($) or an underscore ( \_ ), not number; uppercase and lowercase are sensitive
* hyphens ( - ) are not allowed

### <mark style="color:blue;">Variables</mark>

* declare variables before use
* `let` and `const` are more used; `let` for changable variables; `const` for constant variables; `var` for old browsers
* <mark style="color:orange;">re-declare a variable will not make it lose its value; re-declare doesnt work with</mark> <mark style="color:orange;"></mark><mark style="color:orange;">`let`</mark> <mark style="color:orange;"></mark><mark style="color:orange;">or</mark> <mark style="color:orange;"></mark><mark style="color:orange;">`const`</mark>
* after a number in quotes, the rest of the numbers will be treated as string and no whitespace
* ( $ ) not common, often used as an alias for the main function
* ( \_ ) not common, often used as an alias for "private (hidden)" variables

### <mark style="color:blue;">Let</mark>&#x20;

* in a { } block, variable declared with `var` can be accessed from outside, the rest cannot

### <mark style="color:blue;">Const</mark>

* cannot redeclared; reassigned; have block scope
* a variable declared inside and outside the block is not the same
* Redeclaring an existing `var` or `let` variable to `const`, in the same scope, is not allowed
* Reassigning an existing `const` variable, in the same scope, is not allowed

###
