Javascript

What the FUCK?

Other urls found in this thread:

github.com/aemkei/jsfuck/blob/master/README.md
github.com/mbasso/asm-dom/tree/master/examples/todomvc - cpp/src
twitter.com/SFWRedditGifs

it's garbage.
WASM will destroy this shit in few years.

the scary part is that a lot of modern devs don't give a shit. they just throw shit at the wall until it mostly works and then deploy it. Tests? Support? Security? fuck that noise, it gets in the way of our new flat UI.

sorry I don't speak heiroglyphics

>> [1, 2, 5, 10].sort()
Array [ 1, 10, 2, 5 ]

you can't make this shit up

Have you considered not using the '+' and '-' operators on incompatible types?

have you considered that the language should do that for you before the code ever runs? Strong, static typing is a good thing. Devs hate it though, because it forces them to write less-shitty code and thats too much work.

You are asking a nonsense question. If a function is usable on something then there is code written somewhere to use that operator on that datatype. In programming, that's what an operator is, a function which takes operands (objects, collections, datum) as parameters.
else an error or nothing would be occur

You’re fucking retarded, ANYONE who knows the language understands how these are all handled.

Fucking hell, embarrassing.

Holy shit, manchild. That wasn't even a response.

You realize there are no such things as “types” right? Learn programming basics.

I can't wait until WASM is here and DOM and code inspection will be impossible to do ad or tracking blocking

>wahhhh, the language doesn't hold my hand and forbid me from doing stupid shit
Stick with C brainlet

most websites won't want to host shit themselves, they'll just want to load some third-party resource to serve ads. never underestimate the inclination of a business to outsource and make maintaining something someone else's problem. that'll make ad-blocking not only possible but still easy, just kill third-party JS.

literally inferior to vimscript

And my personal favorite
> typeof NaN
"number"

Even good devs throw shit at the wall, because Javascript is such a fucking nightmare to work in. It's so riddled with inconsistencies you end up just using whatever happens to work.

Will WASM bring back 25kb websites as standard?

No, every website is an AAA video game now

Well, that one actually makes sense, since it's part of the IEEE floating point standard.

No, WASM will bring cryptominers on every site.

>WebDevs
>Capable of writing anything without their 38,000 imported javascript and python libraries

These are all pretty sensible if you know what you're doing

Is there a way to enforce typing on JS? I feel like dynamic typing will fuck me over when I least expect it

...no

use typescript and set up your text editor so it watches the file and compiles it every time you save

don't try to understand it, just know it is an abomination and I hate myself for having to use it.

trigger warning, please

>>> {} + {}
NaN
That's not even right

You've obviously never worked in the industry then, child.

>javascript is for retards! C mustard rice!
*overflows buffer*

...the point is you haven't worked in the industry because you haven't run in the plethora of fucking retards that are out there and "self taught"

Nice try, NEET

the default sorting algo in array.sort() is to sort by string
javascript likes to convert everything to a string unless you keep CONSTANTLY reinforcing and reminding it that your integers are supposed to be numbers with num | 0 and parseInt(num)

WASM is for gaming, VR and simulation

That's how a string sort function should work, retard.

dude weak typing lmao

Arrays can have multiple types of elements. The only way to compare and sort elements of any different types is to convert them to strings and then sort those.

If you think that is mindblowing you should look up JSFuck
github.com/aemkei/jsfuck/blob/master/README.md

kek

>things that you shouldn't do like performing arithmetic on strings produce weird results
wew lad

that's not how sort works you stupid nigger
[1, 2, 5, 10].sort((a,b)=>a>b)
(4) [1, 2, 5, 10]

This

People keep saying that . Until wasm comes js will be deeply rooted in the web.

wasm will never become a viable substitute for javascript until internet explorer is fully dead and removed from the corporate world

MUH WASM

protip: nobody is going to use this shit

VNode* vnode = h("div",
Data(
Callbacks {
{"onclick", [](emscripten::val e) -> bool {
emscripten::val::global("console").call("log", emscripten::val("clicked"));
return true;
}}
}
),
Children {
h("span",
Data(
Attrs {
{"style", "font-weight: bold"}
}
),
std::string("This is bold")
),
h(" and this is just normal text", true),
h("a",
Data(
Attrs {
{"href", "/foo"}
}
),
std::string("I'll take you places!")
)
}
);

This is specifically part of the emscripten API and not part of wasm itself

do you think the dom api for your meme language is going to be any better?

>github.com/mbasso/asm-dom/tree/master/examples/todomvc - cpp/src

1k lines of C++ for a simple todo

top kek

why would you ever do something like that?
literally kys

wasm will make ad blocking impossible

God no, you just have to define operations for ordering a type and you avoid this retarded nonsense

That's why I'm writing my own library.
That's asm-dom.

Yeah, but that's not how an array of strings looks, retard

>sort((a,b)=>a>b)
That's trash.

> (sort '(1 2 5 10)

>Devs hate strong typing
PAJEETS hate strong typing.

(Yes (really (is (much (better (you (stupid (piece (of shit)))))))))

>sort((a,b)=>a>b)
Two pairs of parenthesis, nested.
>(sort '(1 2 5 10)

Man, C# is so much better, put it in the List and be happy

[This,(is)>so==>much,better]