So this is the power of JavaScript™ huh?

So this is the power of JavaScriptâ„¢ huh?

Attached: Incredible.jpg (746x616, 71K)

Okay now convert a String array to a String
you're fighting over nothing
js has issues but this isn't one of them

{}+{}=X

You should be able to solve this.

How many layers of abstraction are we on right now?

Attached: g1.jpg (750x880, 69K)

an array of chars literally is a string. But this is what javascript does to people. makes them into complete idiots

It is in languages like C.
But somehow, I doubt that's what an array of chars is in js.
In js, they're literally seperate things.

>an array of chars literally is a string.
Depends on the language. In C or Haskell sure, in Java or C# or C++ no.

It is in C, but even there it's way more than that - the string literal, "abcd", for example, is declared by putting characters into quotes, and this declaration can't be used for arrays of any other types. In most of other languages, strings are objects that are completely distinct from internal array types. It is unreasonable to expect every language to treat strings the way C does.

But if you have a string, this will eventually be compiled down into an array of chars (since basically everything is C, which is assembly, in the end). So in the javascript in OP, the array of chars will be converted into a string which then yet will be converted into an array of chars... again. Why isn't the original functionality of simply having an array of chars being a string there?

How many times does the wheel need to get reinvented?

>But if you have a string, this will eventually be compiled down into an array of chars (since basically everything is C, which is assembly, in the end).
stop talking Cnile

>since basically everything is C, which is assembly, in the end

>dog has hair
>you have hair
>you are dog

You should really learn about some languages other than C before you start criticizing language design.

For one, which chars are we talking about? Do you think javascript string internally is an array made out of one-byte characters, two-byte characters, or 4-byte characters?

>this will eventually be compiled down
you realise you're talking about javascript here?

Attached: 53 - 8kEvBrW.jpg (412x371, 27K)

He is wrong, but not about this - modern JS environment support compiling JS to machine code.

wait, are c++ strings more than a char array with a size?

then it becomes implementation dependent, and thus still not correct

Do you honestly think that you can declare an array in C++ and assign a string to it without any conversion?

std::string is a size/capacity/cstring triple, not unlike std::vector.
This design means allocations are amortised so it's cheap to keep appending elements to it.

I think it's fine to assume that we are talking about a good implementation. Keep in mind that I am not trying to defend the standpoint of the original poster.

Why does it do that for run-once scripts anyways?
Is it stored in the browser cache or something

It's useful for resource-intensive scripts, that take a lot of CPU even when you run them once. For reuse of compiled code, I have no idea how they handle it. I don't think it's very important.

I'm talking about effectiveness.