This is JavaScript, programming language of the future, bound to replace majority of other languages...

This is JavaScript, programming language of the future, bound to replace majority of other languages. Say something nice about it.

Other urls found in this thread:

developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call
twitter.com/AnonBabble

>Say something nice about it
Modern JavaScript engines have exceptionally good JIT compilers.

It's bascially LISP light.

It exposes normies to functional programming.

No it's basically C of the nineties except C was actually usefull and designed unlike js.

>he thinks it is basically C because it has C-like syntax

Brendan Eich literally wanted to make a Scheme for browsers when he designed ECMAScript/JavaScript/Mocha/LiveScript

It's basically a systems programming language now that browsers are most of your OS.

>he thinks js is basically scheme because it has lambdas
JS like C has actually terrible portability. C has it bad because the standard library is too small js just has really poor implementations.

The mechanics are based on LISP.
The syntax is based on C.

>hurr durr lambdas does not make it functional
No, but higher-order functions, currying and lexical scoping makes it so.

I mean, JS is NOTHING like C except for the syntax.

JS doesn't have:
call/cc
macros
homoiconic syntax
list as basic datastructure

There really is nothing lispy in JS.

can someone post the qt js anime grill?

>call/cc
developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call

>list as basic datastructure
Objects are basically associative lists though

Also, see

>higher-order functions, currying and lexical scoping makes it so
Holy shit JS is basically SML or Haskell!

I'm creating a content locker with jquery, but running into issues with keep track of the users state. If the user clicks the offer, I want to make sure they follow through before I give them the content. Is this possible with jquery guys?

I like that arrays have built in functional style methods (like map, reduce and filter).

function test() {
try {
return "expected";
} finally {
return "whut";
}
}

test() // returns "whut"

Doing any content locking 100% client side is retarded.
Don't even load the content you are locking until they have clicked an offer/completed it.

rate my js

function fillQtyShipped()
{
let itemCounter = document.querySelectorAll("#allItems
.eachItem").length;
for (var x = 0; x < itemCounter; x++)
{
let qtyOrdered = document.getElementById("qty_ordered" +
x).value;
document.getElementById("qty_shipped" + x).value = qtyOrdered;
}
}

Okay thanks pal

>Holy shit JS is basically SML or Haskell!
Not quite, but dismissing JavaScript as not being functional is just ignorant.

Here is an example of how to do partial bind, for example.
Function.prototype.cutoff = function (argc) {
var ref = this;

return function () {
return ref.apply(this, [].slice.call(arguments, 0, argc));
};
};

Function.prototype.rbind = function () {
var ref = this;
var args = [].slice.call(arguments);

return function () {
return ref.apply(this, [].slice.call(arguments).concat(args));
};
};

var print = console.log.cutoff(1);
var parseHex = parseInt.rbind(16).cutoff(1);

Array(4).fill('a').map(parseHex).map(print);

Pretty based

>jqueery

Fucking kill yourself.

Have any other recommendations?

ES6 is what jquery was aiming for before jquery became shittier than native javascript.