Skip to content

Instantly share code, notes, and snippets.

🚁
Latam po mieście

Piotr Kowalski piecioshka

🚁
Latam po mieście
Block or report user

Report or block piecioshka

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@piecioshka
piecioshka / undefined.js
Last active Dec 22, 2015
undefined is the same as undefined?
View undefined.js
// 1) simple check
console.log(undefined === undefined); // true
// 2) check undefined param in function
(function (undef) {
console.log(undef === undefined); // true
}());
// 3) unexists property
(function (obj) {
@piecioshka
piecioshka / getPeriod.js
Last active Mar 11, 2019
[periodic time]
View getPeriod.js
function getPeriod(period) {
var number, letter, letters, time;
if (typeof period !== "string") {
throw new Error("sorry, only string is correct, not " + typeof period);
}
/**
* Parse number from period.
* @type {number}
@piecioshka
piecioshka / snippet.js
Last active Mar 11, 2019
[empty objects] #JavaScript
View snippet.js
/**
* TEST DATA
*/
var testData = [{}, {a:1}, new RegExp(), [], Object.create(null), [undefined]];
/**
* Check if param is Object?
* @param {*} o Checks value.
* @return {boolean}
*/
You can’t perform that action at this time.