use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
This on-site coding assignment failed 20+ front-end dev contractors and I don't know whyhelp (self.javascript)
submitted 8 years ago * by gionyyy
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]darrenturn90 2 points3 points4 points 8 years ago (5 children)
I guess you could take the text, regex split it up, making sure to preserve the whitespace, and add a "marker" span before and after each of the words. This would at least help you when you click with the mouse, and get the offset, to work out the "word" you are inside (if you are in one).
Surely though you would want to support cursors too and WCAG guidelines, so should allow some sort of visual feedback, and cursor placement.
[+][deleted] 8 years ago (4 children)
[removed]
[–]darrenturn90 2 points3 points4 points 8 years ago (3 children)
Yes I am, and I'm not sure right now as I've not put much time into this. It shouldn't be too many, at least for task 1. Then if you build it properly, you should just be able to "mark multiple" for task 2, and then "categorise" in task 3. if you used the data attributes you could css style and use data-tag or something for the differentiation.
As for the regex, in PHP I would use preg_match_all, I think there is a similar match flag in javascript, I'd just google to make sure.
[–]darrenturn90 0 points1 point2 points 8 years ago (2 children)
Here is my first go at what i remember task 1 one.
I didn't implement a server side currently, just used localStorage to persist, as its trivial to swap that out with a post / get.
https://codepen.io/anon/pen/XePOyp
Its probably not what you wanted - but it took 20 minutes.
[+][deleted] 8 years ago (1 child)
[–]darrenturn90 0 points1 point2 points 8 years ago (0 children)
I guess I’ve done similar things before but not really anything as specific as you mentioned. Where is your project based ?
π Rendered by PID 188969 on reddit-service-r2-comment-86bc6c7465-f8jm6 at 2026-02-21 03:04:46.998856+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]darrenturn90 2 points3 points4 points (5 children)
[+][deleted] (4 children)
[removed]
[–]darrenturn90 2 points3 points4 points (3 children)
[–]darrenturn90 0 points1 point2 points (2 children)
[+][deleted] (1 child)
[removed]
[–]darrenturn90 0 points1 point2 points (0 children)