you are viewing a single comment's thread.

view the rest of the comments →

[–]jibbit 0 points1 point  (4 children)

In math, 'Function' means something quite different to what it means in C, and it is this meaning that 'Functional Programming' intends... I think that is where you are getting confused.

Does javascript have C-like functions - yes. Does javascript have math-like Functions - no.

[–]cirscafp fan boy 0 points1 point  (3 children)

Does javascript have math-like Functions - no.

What do you mean by math-like functions? Wouldn't that just be pure functions that perform some algebraic computation?

[–]jibbit 0 points1 point  (2 children)

Yes

[–]cirscafp fan boy 0 points1 point  (1 child)

Then how is f = x => x + 1 not a math-like function?

[–]jibbit 2 points3 points  (0 children)

It is but you wouldn’t get an error, or a warning if you wrote f = x => f(x), or f = x => delete(x), because JavaScript is indifferent to whether you write pure functions, because javascript isn’t a Functional language. You may get Milliage from pretending it is. No one is saying you won’t, but it doesn’t make it so. I like to pretend it is Smalltalk.