tailieunhanh - Pro JavaScript Techniques phần 2

bjects là những đơn vị cơ bản của JavaScript. Hầu như tất cả mọi thứ trong JavaScript là một đối tượng và lợi dụng của thực tế đó. Tuy nhiên, để xây dựng một ngôn ngữ hướng đối tượng vững chắc, JavaScript bao gồm một kho vũ khí lớn các tính năng mà làm cho nó một ngôn ngữ cực kỳ độc đáo, trong khả năng và phong cách. | CHAPTER 2 Object-Oriented JavaScript are the fundamental units of JavaScript. Virtually everything in JavaScript is an object and takes advantage of that fact. However to build up a solid object-oriented language JavaScript includes a vast arsenal of features that make it an incredibly unique language both in possibilities and in style. In this chapter I m going to begin by covering some of the most important aspects of the JavaScript language such as references scope closures and context that you will find sorely lacking in other JavaScript books. After the important groundwork has been laid we ll begin to explore the important aspects of object-oriented JavaScript including exactly how objects behave and how to create new ones and set up methods with specific permissions. This is quite possibly the most important chapter in this book if taken to heart as it will completely change the way you look at JavaScript as a language. Language Features JavaScript has a number of language features that are fundamental to making the language what it is. There are very few other languages like it. Personally I find the combination of features to fit just right contributing to a deceptively powerful language. References A fundamental aspect of JavaScript is the concept of references. A reference is a pointer to an actual location of an object. This is an incredibly powerful feature The premise is that a physical object is never a reference. A string is always a string an array is always an array. However multiple variables can refer to that same object. It is this system of references that JavaScript is based around. By maintaining sets of references to other objects the language affords you much more flexibility. Additionally an object can contain a set of properties all of which are simply references to other objects such as strings numbers arrays etc. . When multiple variables point to the same object modifying the underlying type of that object will be reflected in all

TỪ KHÓA LIÊN QUAN
crossorigin="anonymous">
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.