Function(s) in module : question

hi,
I don’t understand why in this basic example only one function works (random and not timer).

Could you explain why and the solution, please ?

:speech_balloon:index.html

	<script src="js/utilities/variables.js"></script>
	<script type="module" src="js/utilities/utils.js"></script>
	<script type="module" src="js/core/main.js"></script>

:speech_balloon:variable.js

var random;
var timer;

:speech_balloon:utils.js

import * as THREE from "https://threejs.org/build/three.module.js";
import {
	TWEEN
} from 'https://unpkg.com/three@0.125.2/examples//jsm/libs/tween.module.min'


timer = (fonction, duration) => {
	let dummy = new THREE.Object3D()
	let tw_timer = new TWEEN.Tween(dummy.position)
		.to({
			x: 0,
		}, duration)
		.easing(TWEEN.Easing.Linear.None)
		.start()
		.onComplete(() => {
			fonction()
		});
}

random = (min, max) => Math.floor(Math.random() * (max - min + 1) + min);

:speech_balloon:main.js

import * as THREE from "https://threejs.org/build/three.module.js";
import {
	TWEEN
} from 'https://unpkg.com/three@0.125.2/examples//jsm/libs/tween.module.min'


console.log(random(0, 100)) // ouput is : number => ok it works

timer(() => {
	console.log("test ok!");
}, 100) // ouput is : nothing :( normaly i must see "test ok"

TWEEN.update() in the requestAnimarionFrame is missing maybe ?

Thanks, what i’m stupid :roll_eyes: