Advantages its.a(); has over alert();
It doesn't alert you.
It will traverse all the properties of your arrays and objects.
It has accurate type detection.
It has been built entirely in codepen and its.a() nice addition for live reload environments.
It's just as informative with a traditional refresh.
Advantages its.a(); has over console.log();
console.log() is built into its.a(), saving you the additional effort of typing console.log();
its.a() is 4 characters less to type.
its.a() has type detection on array and object values and properties.
String:
its.a(numberString );
// -- Number String Test -- //
var numberString = '1';
its.a(numberString);
Number:
its.a(number);
// -- Number Test -- //
var number = 1;
its.a(number);
Boolean:
its.a(trueTest);
// -- Booleon Test -- //
var trueTest = true;
its.a(trueTest);
Not a Boolean:
its.a(itsNotABooleon);
var itsNotABooleon = 'true';
its.a(itsNotABooleon);
Date
its.a(date);
// -- Date Test -- //
var date = new Date();
its.a(date);
Array
its.a(newArray);
// -- Array Type Test -- //
var newArray = [ 1, 'hello', true ];
its.a(newArray);
arrayWithObjects
its.a(arrayWithObjects );
// -- Array with objects -- //
var arrayWithObjects = [{
"city": "Dallas",
"state": "TX",
"zip": 75201,
"price": 162500
},{
"city": "New York",
"state": "NY",
"zip": 00010,
"price": 962500
}];
its.a(arrayWithObjects);
Simple Object
its.a(ObjectTest );
// -- Simple Object Test -- //
var ObjectTest =
{
"key1": {
"1":"The value of key1 in ObjectTest"},
"key2": "The value of key2 in ObjectTest",
"key3": "The value of key3 in ObjectTest"
};
its.a(ObjectTest);
More Complex Object
its.a(multiStructuredObject);
// -- Object containaining a variety of properties types -- //
var multiStructuredObject = {
foo: "bar",
foo2: "foo2",
arr: [1,2,3],
subo: {
foo2: "bar2",
anotherfoo: "bar3",
newArr:[1,2,3],
subsubo: {
foo3: "bar3"
}
}
};
its.a(multiStructuredObject);
Single Element
its.a(document.body);
// -- Element Test -- //
its.a(document.body);
HTML Collection
its.a(document.getElementsByTagName('li'));
// -- Element Test -- //
its.a(document.getElementsByTagName('li'));
HTML Nodelist
its.a(document.querySelectorAll('li'));
// -- Element Test -- //
its.a(document.querySelectoryAll('li'));
Remove all messages
its.clearAll();
its.clearAll();