V
V
vladislavprozorovskiy2018-03-28 10:00:19
JavaScript
vladislavprozorovskiy, 2018-03-28 10:00:19

Differences between Import and require?

Good afternoon everyone, I wanted to know what are the differences between import and required in javascript. For example, we have two connections

import './components';
require('./helpers');

What is their difference? I would be grateful for a detailed answer or a link to a resource where you can read

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dasha Tsiklauri, 2018-03-28
@vladislavprozorovskiy

in the number of copy operations, among other things, link

I
Ivan, 2018-03-28
@LiguidCool

The import is fresher and a bit more convenient when getting variables from the export.
Basically, the difference is in support - it won't work everywhere without Babel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question