export let one = 1;
export let two = 2;
import {one, two} from "./nums";
alert( `${one} and ${two}` ); // 1 and 2
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="main.js"></script>
</head>
<body>
</body>
</html>
у main.js такой код
import {one, two} from "./nums";