Ad
  • Custom User Avatar

    Thank you YinYangHeart.

  • Custom User Avatar

    Thank you tomatosonic.

  • Custom User Avatar

    I have fixed the typo. Thank you for noticing that detail and bringing it to my attention.

  • Custom User Avatar

    If there is no longer any issue, please mark this as issue resolved. Thank you for addressing this.

  • Custom User Avatar

    What language are you trying to do the Kata in?

    The ASCII value of the character "1" is 49. 49 converted to binary is 110001. If there is a leading zero (as in 0110001), you are supposed to omit this as stated in the directions. You would not include a zero for the sign of the number, because you are only interested in the string character itself for this kata and not its numeric information.

    Where is your 4th zero located?

    Thank you for raising your concerns.

  • Custom User Avatar

    I agree with you. I wrote this three years ago and forgot all about it. I was just raising a question to see if I could understand things better. I was still learning at the time. I'm still learning today. Template literals are a great tool and people should defintiely learn how to apply them in their Javascript programming. I'm glad I did.

  • Custom User Avatar

    I strongly disagree with the other feedback on your comments. Descriptive commenting is a great example of best practices, and while it is not very common on Codewars, in the professional world it is going to make your code infinitely more workable and readable. You will stand out to employers, your co-workers will appreciate you, and when it comes time to modify/update a past project, you and/or your co-workers will not have to waste time reverse-engineering your code just to figure out what each variable and code block did in the first place before you can even begin to make any progress. It will make you more efficient and productive in the long run, especially on large-scale projects.

    It's true that you are indeed giving some very rudimentary comments, which could potentially be improved upon--something which the others have unproductively alluded to. If you are trying to help remind yourself or to teach others some of the things you've learned along the way, you could try to include some more descriptive details, such as what exactly pushing the integer to the array does (adds an element to the end of the array with that integer value) or what returning the result does (allows you to retrieve that value or object when you access it through a call to the function, often based on the input sent through its parameters).

    Most importantly, don't ever let anyone convince you that you've worked too hard, even if you've made a mistake, or many. Those are opportunities to learn. Learn everything you can from them. They will always make you better, and never doubt that you were right to try fearlessly.

    But the only thing that people who try to cut you down to their size should teach you is just how much smaller they intend to stay.

    Codewars Code of Conduct

  • Custom User Avatar

    Please add random test cases in Javascript. See my updated "solution" below (I did solve the Kata correctly first.)

  • Custom User Avatar

    Thank you for exposing the need for random test cases.

  • Custom User Avatar

    Thank you, correction has been made.

  • Custom User Avatar

    This is not a criticism on the solution itself, but just wondering if the use of Template Literals ( ` ` ) should really be getting voted as Best Practices when up to 6.72% of browsers worldwide still don't fully support it?

    https://caniuse.com/#feat=template-literals

    This includes no support in IE, which that alone would currently (Aug-10-2019) include over 4% of North American users:

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Browser_compatibility

    https://gs.statcounter.com/browser-market-share/all/north-america/#monthly-201807-201907

  • Custom User Avatar

    You're correct my spelling of occurrence was not right, I appreciate the heads up!

  • Custom User Avatar

    Oh gotcha! I updated as follows:

    "You should remove any duplicate characters, keeping the first occurance of any such duplicates, so they are in the same order in the final array as they first appeared in the input string."

  • Custom User Avatar

    I took your suggestion on removing the input validation.

  • Custom User Avatar

    If you have to choose, keeping the first occurance of each character would make the most sense, as that would leave you with your characters in the same order as they first appeared in the original string once you filter everything else out.

  • Loading more items...