Professional JavaScript for Web developer——2. EMCAScript(基本语法)

EMCAScript定义了JavaScript的基本语法以及面向对象的属性和方法;

注意:JavaScript其实是一种完全面向对象的编程语言,

变量、函数等所有的一切在这里都可以看作对象,都具有自己的属性和方法(有些可能是隐藏的,但确实可以使用它们,这些称为伪对象)


1. EMCAScript定义的JavaScript的基本语法:

1)基本注意事项:
区分大小写;
变量弱类型;
结尾用分号(可省略);
注释;

2) 变量的定义:
var variablename=...;

3) 变量的类型:

a) Primitive type:
Undefined (使用var定义了,但没有初始化);
Null (不存在);
Boolean ;
Number;
String;

其实都是伪对象,具有属性和方法:
length;
toString等

用于转换类型的函数:
parseInt
parseFloat
Boolean
Number
String

b) 引用类型(其实就是类,对象)
Object
Boolean
Number
String
各个类都有自己的属性和方法;

4) 运算符:
5) 语句:
6) 函数:
需要知道的是,函数也是对象(以及使用arguments对象实现函数重载)

<JavaScript这些基本的语法知识,不需要死记,有印象,使用的时候在查询确认的过程中,加深记忆,无法忘记>




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
This book provides a developer-level introduction along with more advanced and useful features of JavaScript. Coverage includes: JavaScript use with HTML to create dynamic webpages, language concepts including syntax and flow control statementsvariable handling given their loosely typed naturebuilt-in reference types such as object and arrayobject-oriented programingpowerful aspects of function expressionsBrowser Object Model allowing interaction with the browser itselfdetecting the client and its capabilitiesDocument Object Model (DOM) objects available in DOM Level 1how DOM Levels 2 and 3 augmented the DOMevents, legacy support, and how the DOM redefined how events should workenhancing form interactions and working around browser limitationsusing the tag to create on-the-fly graphicsJavaScript API changes in HTML5how browsers handle JavaScript errors and error handlingfeatures of JavaScript used to read and manipulate XML datathe JSON data format as an alternative to XMLAjax techniques including the use of XMLHttpRequest object and CORScomplex patterns including function currying, partial function application, and dynamic functionsoffline detection and storing data on the client machinetechniques for JavaScript in an enterprise environment for better maintainability This book is aimed at three groups of readers: Experienced object-oriented programming developers looking to learn JavaScript as it relates to traditional OO languages such as Java and C++; Web application developers attempting to enhance site usability; novice JavaScript developers. Nicholas C. Zakas worked with the Web for over a decade. He has worked on corporate intranet applications used by some of the largest companies in the world and large-scale consumer websites such as MyYahoo! and the Yahoo! homepage. He regularly gives talks at companies and conferences regarding front-end best practices and new technology.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值