博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Forget Java to learn Javascript from 0.--Day 1
阅读量:6080 次
发布时间:2019-06-20

本文共 2133 字,大约阅读时间需要 7 分钟。

The first day,when I read 'we need practice so we need a Javascript Interpreter.','Every browser has Javascript Interpreter.'

we can find them in the SETTING or TOOLS-> Developement Tools/Web console or just right click the page INSPECT ELEMENT.

so we don't need to install ANYTHING unless the browser,I know Chorme even IE 9 is fine,but Firefox is better.

 

Firstly , this book recommend a powerful tool called "Firebug",since I already bought this book,I would like to buy this tool and it's FREE!(Yay!)

the link to download Firebug is http://getfirebug.com/downloads (ONLY for Firefox,however FF is a better browser.I don't want to explain it now,we will see).

 

Secondly,I learnt the console.log() alert() to get some output.(seems like System.out.println() )

and then,I learnt "var" var for variable.

 

var x;      //define a varx = 0;     //var can be numberx = 0.1;  //var can be float in JAVA,however it's Javascriptx = "hello world" //var can be stringx = 'Javascript'    //single quote is same,save our SHIFT,use single quotex = true            //var can be booleanx = null            //I feel var can be everything!!!x = undefined     //very similar to null

"var" is like a baby,it's nothing,but it can be anything if you want.

 

most important part in Javascript is Object.

Object is name,value pair.

var book = {topic : "Javascript",       //the topic is like a field in Java//"Javascript" is its value.     fat:     "true"}; //and we can get the value of the "field" this way book.topic // => it will be "Javascript" book["fat"]//another way //It's so simple and plain,let's learn something CRAZY!!!Yay!

it looks like just another way to write Java,right?Just don't use a specific type like int,float,string.

Is it that way?Come on!We will see.

book.author = 'Flanagan';    //give it a new field and value after it already buildbook.contents = {}//give it a new object which is currently empty

NEVER know something like this before in Java right?

'Reflection' ? Yes,but this way is much more cleaner and beautiful,right?

I feel I start to like this little cute staff now.

转载于:https://www.cnblogs.com/browncrane/p/learnJS_1.html

你可能感兴趣的文章
低版本Samba无法挂载
查看>>
Telegraf+Influxdb+Grafana构建监控平台
查看>>
使用excel 展现数据库内容
查看>>
C#方法拓展
查看>>
MySql.Data.dll的版本
查看>>
Linux系统磁盘管理
查看>>
hdu 2191 (多重背包+二进制优化)
查看>>
home.php
查看>>
neo4j---删除关系和节点
查看>>
redis分布式锁redisson
查看>>
什么样的企业可以称之为初创企业?
查看>>
Python爬虫之BeautifulSoup
查看>>
《HTML 5与CSS 3权威指南(第3版·下册)》——第20章 使用选择器在页面中插入内容...
查看>>
如何判断自己适不适合做程序员?这几个特点了解一下
查看>>
newinstance()和new有什么区别
查看>>
android下载封装类
查看>>
[node] 用 node-webkit 开发桌面应用
查看>>
Nginx访问控制和虚拟主机
查看>>
report widget not working for external users
查看>>
windows phone 摄像头得到图片是旋转90°
查看>>