Skip to content

Tag: javascript

discord.js “TypeError: fn is not a function”

So I started getting this “TypeError: fn is not a function” after I added the if-else statement to the code Thats the code I have and my error is Thank you to anyone that is able to help me find a fix for this. Answer It’s because .some() accepts a callback function only but notverified is a…

React page rendering blank with event listener functions

Having an issue with my code, causing the page to render blank. New to react so any help would be appreciated. I’ve scoured SO to try and find an answer but haven’t found anything that seems to work. I’m aware the syntax for react is incorrect in the functions causing the issue, just looking…

Need help understanding this longest substr algorithm Javascript

Why are they using the line: start = Math.max(start, seen[char]); Wouldn’t I want the max of the start not the seen[char]? I’m confused on how this algorithm works. Answer start stands for where we start counting length of current (unique letters) substring. seen[char] stands for last position of …