function delay(time) {
return new Promise(resolve => setTimeout(resolve, time));
}
delay(1000).then(() => console.log('ran after 1 second1 passed'));
function functionName(parameter1, parameter2, parameter3) {
body code goes here
}
function nama_function(parameter/argument 1, parameter/argument 2, ...) {
[Isi dari function berupa tindakan/steatment]
return [expression];
}