The Javascript console is a wonderful tool to debug your code and I myself have a lot of fun using it and mainly to work out what the heck I have done wrong! Most people assume you are only limited to console.log(). Did you know their is a whole host of options available to you? If no then please look below, this will help when attacking console debugging: [js] // this starts a profile. Put at start of your script and closing later console.profile("Profile 1"); // timer to give time of how long it takes to get from here to closing point console.time("timer 1"); // default, notice you can pass multiple things to it, by seprating by , not just + console.log('Captain\'s Log1 ', new Date()); // info log, not just text, is blue and icon console.info('Ammo supplies moderate'); console.debug('Sheild\'s are up'); // gives yellow icon warning console.warn('Unidentified craft approaching'); // red warning console.error('Fire in the cargo bay!'); // this gives you a list of properties available on an object. Try it on document or window console.dir(document); // puts objects or arrays into nice table format peeps = [["Julian",22,"Cheese maker"],["kris",30,"Maker maker"],["Jerry",60,"Laugh maker"],["Tom",30,"Tory maker"],["Dick",30,"Love maker"],["Harry",30,"Bread maker"]] console.table(peeps); console.timeEnd("timer 1"); //timer end console.profileEnd("Profile 1"); //profile end [/js] Screen grab when those are run: console-log As you can see their is quite a lot of options to work with to output data, set timer start and endpoints, output different console messages etc. These will help show different things at different points, for example, you could have the console.warn(); fire whenever your javascript runs into errors. It opens up what you can do and helps rather than just seeing text output to the console. Well I hope this helps you and have a nice day!

Monthly Archives: November 2013

Javascript Console

The Javascript console is a wonderful tool to debug your code and I myself have a lot of fun using it and mainly to work out what the heck I have done wrong! Most people assume you are only limited to console.log(). Did you know their is a whole host of options available to you?

Read more

James Bond Intro CSS

I had the idea to try and attempt to do the james bond intro in CSS in the browser. So after a good few weeks of only getting an hour here or there to work on it, I have finally finished it and hopefully you enjoy it. Please use firefox or Chrome on desktop to

Read more