Skip to content

Category: Questions

Node js Uncaught SyntaxError: Unexpected identifier

When I call node filename.js then it return an error.(Uncaught SyntaxError: Unexpected identifier). How can I fix it? Thanks Answer You are inside the node command mode after you type node, you should quit with Ctrl + C and you only need to run your js file in the terminal with node jsfile.js instead of runni…

I can’t get the value of the variable

I’m learning JavaScript and there is a question that I can’t understand: Consider the given code: The value of modifiedNames here will be? I am printing the variable in the console but it gives me undefined?! Thank you in advance. Answer You use Array.prototype.forEach which always returns undefin…

Auto Reaction Roles / Discord.js Bot

So I’m having a slight issue getting my auto roles to work I have been trying to sort it via message.js and in the reactionrole.js but its still giving the same issue wondering if anyone can help would be appreciated as I have looked up about it via tutorials and apart from a few differences due to diff…

Extract Variables From String Regex

This might be a repeat question but I’m not sure how to look for the answer 😛 I’m trying to extract and remove variables from a string. The string might look like this: !text (<123456789>=<@$111111111>) (<7654312> = <@$222222222>) (🛠 =<@$3333333333>) Some text that I …

Include google analytics in external JS file

I would like to know how I can take the Google Analytics Code below and add it to an external JS file that all the pages are accessing. The code that is in all my html files now: How I want it to be: HTML: google.js: Any help would be appreciated, as I cannot find answers for this elsewhere on

Keep clicking Refresh button until data appears

I have one page for uploading a file which will be processed by the server in the background. I then have a second page where it shows only files that have been processed, which can take anything up …