1. Single-line comments: To write a single-line comment, you can use two forward slashes (//) followed by the comment text. Anything after the double slashes will be considered a comment and will not be executed.
// This is a single-line comment
2. Multi-line comments: If you want to write a comment that spans multiple lines, you can use the forward slash and asterisk (/*) to begin the comment and the asterisk and forward slash (*/) to end the comment.
/* This is a multi-line comment. It can span multiple lines. */
I hope you found the above information helpful. Please let me know in the comment box if you have an alternate answer 🔥 and you can support me by buying me a coffee.
And don’t forget to sign up to our email newsletter so you can get useful content like this sent right to your inbox!