Michael WilliamsPro Student 8,057 Points
Can someone explain "require" in plain english?
Andrew talks about the
require method but doesn't explain it. So I went to the MDN link in the teacher's notes, and that wasn't much more helpful. Can someone explain (in plain English) what he's doing here with the
He starts talking about
require around the 4:30 mark.
Dario Bahena10,687 Points
hypothetical: lets say you have a library that prints "hello" called 'somelib'
const someVariable = require('somelib') // someVariable now contains the library which can be used to access its contents. someVariable.print() // will print "hello"