Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

什么是面向对象(面向对象开发) #30

Open
wuxianqiang opened this issue Jan 7, 2018 · 0 comments
Open

什么是面向对象(面向对象开发) #30

wuxianqiang opened this issue Jan 7, 2018 · 0 comments
Labels

Comments

@wuxianqiang
Copy link
Owner

wuxianqiang commented Jan 7, 2018

JavaScript是一种面向对象的语言。不严格地讲,这意味着我们不用全局的定义函数去操作不同类型的值,数据类型本身可以定义方法(method)来使用。例如,要对数组a中的元素进行排序,不必要将a传入sort()函数,而是调用a的一个方法sort():

a.sort();//sort(a)的面向对象的版本

面向对象的语言有一个标志,那就是它们都有类的概念,而通过类可以创建任意多个具有相同属性和方法的对象。JavaScript有很多内置类,如NumberStringObjectFunction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant