{"size": 489, "ext": "js", "max_stars_repo_path": "promise_example.js", "max_stars_repo_name": "deeptiSingh006/JS", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "promise_example.js", "max_issues_repo_name": "deeptiSingh006/JS", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "promise_example.js", "max_forks_repo_name": "deeptiSingh006/JS", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 18.1111111111, "max_line_length": 85, "alphanum_fraction": 0.5807770961}
let p = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve(10);
  }, 300);
});
p.then((result) => {
  console.log(result);
  return result*2;
}).then((result) => {
    console.log(result);
    return result * 3;
});

//=====promise rejection is handle by .catch and fullfilled state is handled by .then
 new Promise((resolve,reject)=>{
   setTimeout(()=>{
     reject(Error('promise failed'))
   },1000)
 })
 .then(()=>{})
 .catch((error)=>{console.error(error)})

 

 

 