Ask coding questions

← Back to all posts
require() not defined in my JavaScript file
RixTheTyrunt

I want to detect the file's content as an array. I found one method that should work, but, an error, as always, appeared. Here are the files for code and console ( I'm tired of writing and my writing speed is low, but not so low ) :

Voters
RixTheTyrunt
Comments
hotnewtop
SixBeeps

require() is a function that specifically only works when working with Node.js. It will not work in the browser. Either switch over to Node or use a different method