The close() method of the WritableStream interface closes the associated stream.
close()
MDN Reference