Rasi
answered Nov 30 '-1 00:00
import statement is not native implemention means you cant use it your browser . you need external library to use import .
external library like
Traceur Compiler, Babel, Rollup or Webpack.
what is import statement ?
import is used to import function or objects or primitives from external modules or another script .
how to use ?
export will define object or function or primitives as importable
---oneFile.js---
export var a='data';
<script src="ajax.js"></script>
import { a} from "ajax.js";
but it give error now because native browser dont have export or import stantment
Error caused for native browser
Uncaught SyntaxError: Unexpected token export
Uncaught SyntaxError: Unexpected token import