r/learnjavascript • • Nov 23 '21

I finally solved a codewars challenge without actually googling anything :) it feels so good to come up with the code all by myself, i know its not the ideal way to solve it but im still happy. The challenge was to create a function that converts a string to a number

Post image
243 Upvotes

56 comments sorted by

View all comments

11

u/Loud_Type_1756 Nov 23 '21

I am a newbie and totally unable to grasp this solution. 😔

8

u/Darkthw Nov 23 '21

I'm a newbie just like you, I've never build anything. Right now I don't have a PC so I've been doing a lot of codewars on my phone. I've learned a lot just from Googling things I can't do, never done any course just YouTube videos.

6

u/[deleted] Nov 23 '21 edited Nov 23 '21

Please look into the actual ways to do this task, you can't write these in production.

Btw great job grasping one key concept & solving it by yourself

4

u/Darkthw Nov 23 '21

Will do. What do you mean by " in production "

8

u/[deleted] Nov 23 '21 edited Nov 23 '21

By production I meant when your code will be available for public use, for example we are using reddit, we are production users of reddit, there are other internal users of reddit who are involved with the development of the app/website.

When you are creating a software to be used by people other than you ( more than 100 may be a good number) you should write tight n neat code, leaving less room for bugs. The way you converted string to integer is error prone and might cause lot of bugs.

Dont get intemidated by what I am saying, start slowly you will learn over the years, the more u write the more u learn.

Edit: crossed out the line that was wrong and may cause confusion to new guys

2

u/Darkthw Nov 23 '21

OK thanks. What do you think is the first thing a beginner should try and build

5

u/[deleted] Nov 23 '21

Start with some simple projects, like tic tac toe, snake game, calculator( they are daunting for beginners but you will learn and grow a lot while writing them)

Or you can start doing odinproject or freecodecamp projects in javascript sections, they are more curated and will guide you step by step.