// The basicsconsole.log("console log")// standard outputconsole.info("console info")// standard outputconsole.debug("console debug")// blue text outputconsole.warn("console warn")// warning icon with orange text outputconsole.error("console error")// error icon with red text output// JavaScript with "style" :)console.log("%cAlba Web Studio","color: CornflowerBlue; font-size: 2rem;")console.log("%cAlba %cWeb Studio","color: white; font-size: 1.5rem;","color: CornflowerBlue;")// TableslettableData=[["Andrew"],["Pauline"],["Dayton"],["Gage"],["Kobe"]]console.table(tableData)// Groupsconsole.group()console.log("Root Message")console.group("Secondary Message")console.log("Item One")console.log("Item Two")console.groupEnd()console.groupEnd()// navigate through object propertiesletinfo={"businessName":"Alba Web Studio","slogan":"imaginative designs and solutions","website":"https://albaweb.studio"}console.dir(info)console.dirxml(document.body)// Assert | will only print false argumentsletname="Andrew"letmsg="! Hotdog"console.assert(typeofmsg==="number",{name:name,msg:msg})// You can "count" on itfor(leti=0;i<10;i++){console.count("Aah-aah-aah")}// Check speed of executionconsole.time("Time")letj=0for(leti=0;i<10;i++){j+=i}console.log("total",j)console.timeEnd("Time")
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.