Hi everyone! I am working on my first JavaScript certification project and I’m concerned that I studied the example too closely. Before I submit the project, I want to get feedback about whether my JavaScript is too similar to the example’s JavaScript. I want to maintain academic integrity.
First, what I did: I read the example’s JavaScript, typed out a substantially similar version, and commented it to make sure I understood it. Then I looked some things up on W3C to see their explanations and how their examples worked. Then I deleted my copy and typed out an algorithm for myself. Finally, I started the script.js file again, writing the code without referencing the example any further.
FYI, your JS on github doesn’t work in FCC because you didn’t declare outputTxt with either let or const.
As to your question, in my opinion, your code looks way too similar to the example FCC code. For example, why did you feel the need to save the input passed into the function in the variable originalInput? It doesn’t need to be saved off. You aren’t changing the value of input in the function. You can do away with originalInput completely. So you can see why it might seem that the only reason you did that is because the FCC code does it.
When creating the processedInput variable, why did you call replace before toLowerCase? If you called toLowerCase first then the regex for replace would be even simpler. Again, it gives the appearance that you called replace first because the FCC code did.
And there is no reason you need to remove the p element inside #result and then create a new p element each time like the FCC example does. The FCC code is doing unnecessary work. You can just change the value of innerHTML on the same p element over and over. Again, it gives the appearance you did this because the FCC example does.
And your checkPalindrome function does exactly the same thing as the FCC checkPalindrome function. Personally, I think the FCC checkPalindrome function is doing too much. The name implies it does one thing: checks if the input is a palindrome. Thus, it should return either true or false and should probably be named isPalindrome. You could have another function that actually writes the string to #result. But you have made it do everything that the FCC example does, which again gives the appearance that you relied too much on the FCC JS.
Please don’t take this as me accusing you of cheating. That’s not what I am doing here. From what you wrote above, I don’t believe you intended to. But just the fact that you wrote this post leads me to believe that you see these similarities as well and realize that perhaps this is just to similar to the FCC example. Maybe you should just delete this completely and forget about it for a while, move on in the JS curriculum and then come back to it after you finish the Roman Numeral Converter? Also, I would highly recommend you do not look at the JS code for any of the other projects until after you have successfully completed each project.
First, thank you very much for looking at this for me and for your detailed and specific feedback! I know you’re not accusing me of cheating, and you’re right that I posted this question to make sure that I don’t.
I will definitely take your suggestion to delete it and come back to it with a fresh brain after moving on through the course to the next certification project, and I have learned my lesson about looking at the example website’s code!