This is JavaScript, programming language of the future, bound to replace majority of other languages. Say something nice about it.
>>60194358
>Say something nice about it
Modern JavaScript engines have exceptionally good JIT compilers.
>>60194358
It's bascially LISP light.
>>60194358
It exposes normies to functional programming.
>>60194429
No it's basically C of the nineties except C was actually usefull and designed unlike js.
>>60194482
>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.
>>60194511
>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.
>>60194482
The mechanics are based on LISP.
The syntax is based on C.
>>60194543
>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.
>>60194551
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?
>>60194581
>call/cc
https://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 >>60194580
>>60194580
>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?
>>60194358
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"
>>60194674
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 jsfunction 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;
}
}
>>60194725
Okay thanks pal
>>60194647
>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);
>>60194848
Pretty based
>>60194674
>jqueery
Fucking kill yourself.
>>60194998
Have any other recommendations?
>>60195060
ES6 is what jquery was aiming for before jquery became shittier than native javascript.