JavaScript can display data in different ways depending on the use case.
innerHTML — Write to an HTML elementdocument.write() — Write to HTML document (testing only)window.alert() — Alert boxconsole.log() — Browser console (for debugging)console.error() — Red error in consoleconsole.table() — Table in consoleEdit the code below and click Run to see the result live.