Is there an equivalent construct in Javascript. If not, how would you create one?
Here’s a straightforward explanation of what the infix operator does in Haskell:
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
JavaScript doesn’t have a list type, but it has
Arrays.You can use…
Alternatively, you could use
unshift()to prepend to an array, but it mutates the original.JavaScript doesn’t have a
:operator, operator overloading or methods that look like operators, so you can’t get a similar syntax as Haskell.