Eloquent JavaScript Introduction
Eloquent JavaScript Introduction
Introduction:
Learning Outcomes:
1: Programming is set of instruction used to interact with computer. Or to tell a computer what to do.
2: JavaScript is one of the computer language that we use to interact with browser. It is built in in almost
every web browser.
3: A program is data in the computer’s memory at the same time it controls actions performed on this
memory.(Program is a directing force what tells a computer what to do with date i.e. Which is also a
program).
4: In order to make a computer do what we want we have to figure out a way to connect these parts
and make it work according to our own needs.
5: Author disagree with programming best practices. He says someone made these practices from their
own convenience. But programming is very divers and young, so we have to leave room for new ways.
6: Good programming come with practice not from the set of rules predefined by someone.
7: We should write program that is easy to understand. And at the same time we should go outside the
box to try new things because modern problems require modern solutions. Sticking to only predefined
best practices might not be able to solve new problems.
Set “total” to 0.
Set “count” to 1.
[loop]
Set “compare” to “count”.
Subtract 11 from “compare”.
If “compare” is zero, continue at [end].
Add “count” to “total”.
Add 1 to “count”.
Continue at [loop].
[end]
Output “total”.
1. A simple instructions of English language are:
Store the number 0 in memory location 0.
2. Store the number 1 in memory location 1.
3. Store the value of memory location 1 in memory location 2.
4. Subtract the number 11 from the value in memory location 2.
5. If the value in memory location 2 is the number 0, continue with
instruction 9.
6. Add the value of memory location 1 to memory location 0.
7. Add the number 1 to the value of memory location 1.
8. Continue with instruction 3.
9. Output the value of memory location 0.
Dry Run: