The Comment() constructor returns a newly created Comment object with the optional string given in parameter as its textual content.
new Comment()
new Comment(content)content OptionalA string representing the textual content of the comment.
A new Comment containing content, or the empty string if no parameter was given.
const comment = new Comment("Test");Document.createComment() is an outdated alternative to this constructor.