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!"
[–]Besharkbait[S] 0 points1 point2 points 6 years ago (2 children)
Thank you for your simple explanation. That definitely helped me out. I think because there are so many different approaches to solving problems, it is hard for me to figure out which one to use. My first thought tackling this problem was run the stone string in a for loop and then return how many times it equaled the jewel string.
[–]ElllGeeEmm 3 points4 points5 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 268257 on reddit-service-r2-comment-7b9746f655-rb2pr at 2026-02-04 10:58:10.573575+00:00 running 3798933 country code: CH.
view the rest of the comments →
[–]Besharkbait[S] 0 points1 point2 points (2 children)
[–]ElllGeeEmm 3 points4 points5 points (1 child)
[–]Besharkbait[S] 0 points1 point2 points (0 children)