sort() not function?

Alphabetize

Evil3d11
4 years ago

0

so I’ve done this so far>> x = Document.getElementByTagName(textarea)[0].innerHTML; x.split(); x.sort()

but it has returned sort as not a function

9replies
4voices
255views
fred [feuerstein]
4 years ago

0

Split returns an array of substrings. Furthermore: The split() method does not change the original string.

Read the documentation of that functions to understand what you are doing

Evil3d11
4 years ago | edited 4 years ago

0

okay well I’ve developed it a bit more I realised my misake with the last code but I still can’t submit it fast enough.

fred [feuerstein]
4 years ago

0

You should remove that not to spoil too much. You could try to make it inline to be faster

Sciacallo
4 years ago | edited 4 years ago

0

I think I have a similar problem, my code is easier: document.getElementsByTagName('textarea')[0].innerHTML.split(',').sort(); but it seems wrong for the system…am I correct? Have I to set the result to a variable?

fred [feuerstein]
4 years ago

0

Re-read the description of the level, you are missing a thing

dimooz
4 years ago

0

Maybe you could improve your code by adding a submit method in order to do it automatically (and faster)?

fred [feuerstein]
4 years ago

0

That is not the point :) he missed one requested thing of the level

dimooz
4 years ago

0

Yeah I saw but I thought that could also help.. (I didn’t want to give him what’s missing here!)

fred [feuerstein]
4 years ago

0

Nice move from a nice guy B)

You must be logged in to reply to this discussion. Login
1 of 10

This site only uses cookies that are essential for the functionality of this website. Cookies are not used for tracking or marketing purposes.

By using our site, you acknowledge that you have read and understand our Privacy Policy, and Terms of Service.

Dismiss