function

242

function -

function delay(time) {
  return new Promise(resolve => setTimeout(resolve, time));
}

delay(1000).then(() => console.log('ran after 1 second1 passed'));

function -

function functionName(parameter1, parameter2, parameter3) {
  body code goes here
}

function -

function nama_function(parameter/argument 1, parameter/argument 2, ...) {
  [Isi dari function berupa tindakan/steatment]
  return [expression];
}

Comments

Submit
0 Comments