How Can I set the size of the browser window in java script?

How Can I set the size of the browser window in java script?

Hi Dipen,

User need to add below line of code where need to declare variable of width and height and use them in setSize method of selenium which can resize the window size
var width=800; var height=600;

await driver.manage().window().setSize(width, height);