r/webdev • u/memystic • Feb 20 '17
Learn JavaScript With Interactive Challenges X-Post /r/JavaScript
https://edabit.com/explore4
u/SteveB0X Feb 20 '17
I just want to say, this is a really great site. The challenges are very approachable for me, which is something I can't say about the hackerranks and leetcodes. It's exactly what I need right now.
However, I'm having trouble getting my first challenge to submit. My code is printing out the answers to the console, but the test is not accepting them. I.e.,
Duck
Expected: 'Duck', instead got: undefined
3
Expected: 3, instead got: undefined
undefined
Test Passed: Value == undefined
true
Expected: true, instead got: undefined
null
Expected: null, instead got: undefined So to me, it seems like I have the correct code, but the interpreter is not seeing my answers. What is the correct way to print the output so it is accepted?
3
u/memystic Feb 20 '17
Works fine for me. Go to this challenge and paste this into the Code tab:
function getLastItem(arr) { return arr[arr.length - 1] }Click the "Check" button. Should work fine.
2
u/SteveB0X Feb 20 '17
Oh I get it now! I'm so used to console.log-ing everything, when all I needed to do was return my lastItem variable by itself.
Thanks!
2
u/memystic Feb 20 '17
No problem, if you have any other questions just PM me or email [email protected]
1
u/memystic Feb 20 '17
When I click that link reddit gives me an error... Looking at the stats, I'm not seeing anyone else having issues doing Checks / Submit Finals. Can you PM me the code without spoiler thingys?
1
u/SteveB0X Feb 20 '17
The spoiler show the code in a tooltip when you hover over the link. I'll pm you the code too just in case
3
u/el_lyss Feb 20 '17 edited Feb 20 '17
You should definitely work on improving load speed. It took more than 10s to load the site the first time for me.
Also you use a meteorjs, right? Well, you should definitely work on SEO, because right now Google thinks your site is literally empty.
1
u/memystic Feb 20 '17
Normally it's very fast but has been getting lots of traffic this morning, hence the slowdown. I've got the frontend on Galaxy and the database on mLab. If traffic stays consistently strong, I'll upgrade to a dedicated mLab server as that seems to be the bottleneck. As for SEO, I know and will be implementing server side rendering next week. Just not a big priority right now.
1
u/rs1712 Feb 20 '17
Running really slow, and meteorjs is throwing alot of errors too
1
u/memystic Feb 20 '17
Can you try again in another browser or clear your cache? I just upped my CPU significantly. Should be fast-ish now.
1
3
Feb 20 '17 edited Feb 20 '17
This is great! Definitely something I would add as a homepage.
One suggestion or feature I would like is, if two submitted solutions are exactly the same, to remove the least upvoted one so it doesn't clog up the list of solutions. Other than that, thank you for building this!
1
u/memystic Feb 20 '17
Yes, I'm working on some code that will minify / remove comments and then combine similar code. This will solve the issue.
3
u/forhlol Feb 21 '17
What are your thoughts on logging in using GitHub? Any chance this will be implemented? I think a lot of people who would use a site like this, may want to login using their GitHub accounts. Just a thought. Great work!
1
u/masterm Feb 20 '17
Was cool until I had to log in to try it. Don't let me do half the thing then try to get me to login
12
u/memystic Feb 20 '17
Code is being executed on my servers. Until I'm sure everything is secure (I just launched this), you'll just have to deal with it.
2
1
u/roly768 Feb 20 '17
Awesome tool you've built here, thank you! My only suggestion would be in regards to the interface. When working on a challenge it would be nice to have the instructions and code visible at the same time so that I don't have to toggle back and forth if I get stuck or need clarification.
1
u/Badrush Feb 20 '17
Hey I just used your site to solve 6 problems and it was great, easy to use. I will keep using it :)
My suggestions:
Make the error console easier to read
Maybe show my runtime and let me see how it compares to other
1
1
1
u/JaniRockz Feb 21 '17
I love it.
Only minor annoyance I encountered was that after basically finishing a task you cant test your code again (to improve it for example) without finishing the whole task (red button).
1
0
u/OriginalPostSearcher Feb 20 '17
X-Post referenced from /r/javascript by /u/memystic
Learn JavaScript With Interactive Challenges: Earn XP, Unlock Achievements & Climb The Leaderboard
I am a bot. I delete my negative comments. Contact | Code | FAQ
0
Feb 20 '17
[deleted]
1
u/memystic Feb 20 '17
Thanks! The solutions are locked until completion. Once you complete the challenge, you'll see all the solutions and can upvote/downvote them.
0
Feb 21 '17
[deleted]
2
u/memystic Feb 21 '17
I totally agree. The solutions tab is my most underdeveloped feature. Soon this will be implemented:
Similar code will be combined.
Rank solutions by efficiency.
Length (for finding those nice one liners).
Etc
17
u/memystic Feb 20 '17
I really hope some people find this to be a fun tool. I spent a little over five months building it by myself.
Before anyone asks, yes, the backend currently supports other languages! Specifically:
C
C#
C++
Elixir
F#
Haskell
Java
JavaScript
Objective-C
OCAML
Php
Python
Ruby
Rust
Swift
Once I’ve smoothed out the rough edges and squashed some bugs, I’ll begin working on rolling other languages out. Also, the challenges right now are rather easy BUT the system allows anyone to publish their own challenges. So if you want harder/more challenges, by all means please help out! :)