课程: Learning Functional Programming with JavaScript ES6+ (2019)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Separation of data and functions - JavaScript教程
课程: Learning Functional Programming with JavaScript ES6+ (2019)
Separation of data and functions
- [Instructor] The second main concept of functional programming is the separation of data and functions. This is a case where functional programming is directly in contrast with object-oriented programming, where data and functions are almost always grouped together. Let's see what this looks like. First of all for our purposes, let's discuss what data and functions actually are. For our purposes, data might be any values that a program contains, people's names, addresses, and social security numbers in a payroll program, the models, years, and colors of cars on a used car website, the positions, health levels and weapons of characters in a video game, anything. All of this is data. In object-oriented programming, this data is usually wrapped up inside objects as member variables, and the only way we can access it is using an object's methods. In functional programming on the other hand, this data is represented by simple arrays and hashes, or in this case, JavaScript objects. And a…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。
内容
-
-
-
(已锁定)
The goal of functional programming3 分钟 38 秒
-
(已锁定)
Declarative vs. imperative programming2 分钟 46 秒
-
(已锁定)
Immutability4 分钟 18 秒
-
(已锁定)
Separation of data and functions1 分钟 47 秒
-
(已锁定)
Object oriented to functional approach3 分钟 29 秒
-
(已锁定)
First-class functions2 分钟 33 秒
-
(已锁定)
Ensuring immutability: ESLint3 分钟 14 秒
-
(已锁定)
Ensuring immutability: Install ESLint1 分钟 14 秒
-
(已锁定)
Ensuring immutability: Finalize ESLint2 分钟 27 秒
-
(已锁定)
-
-
-
-
-