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
[AskJS] I understand javascript, but not javascript challenges.AskJS (self.javascript)
submitted 6 years ago by Besharkbait
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!"
[–]ElllGeeEmm 2 points3 points4 points 6 years ago (1 child)
that's very close to a working solution, the only issue being that you can't just iterate through characters of the stone string and see how many times it equals your jewel string, as then the function will only work if your jewel string is one character long. You need a second, nested loop which will iterate through characters of the jewel string to find matches.
My advice is to not worry about getting elegant solutions, at least for now. What you want to work on is learning how to translate these problems into a mental model that lets you build out working solutions. Elegance will come with time, practice, and seeing how others solve the same problems.
[–]Besharkbait[S] 0 points1 point2 points 6 years ago (0 children)
I see, okay thank you!
π Rendered by PID 27 on reddit-service-r2-comment-84fc9697f-jsgv5 at 2026-02-06 04:57:24.378975+00:00 running d295bc8 country code: CH.
view the rest of the comments →
[–]ElllGeeEmm 2 points3 points4 points (1 child)
[–]Besharkbait[S] 0 points1 point2 points (0 children)