There is no built-in function, but you can define your own:
Date.prototype.endOfWeek = function(){
return new Date(
this.getFullYear(),
this.getMonth(),
this.getDate() + 6 - this.getDay()
);
};
var now = new Date();
console.log( now.endOfWeek() );
source
share