Joined August 2012
·
Posted to
Enhance your JS console logging messages
over 1 year
ago
What might be worth to add is that you shouldn't program and expect console.log
to exists since it's not part of any standard. With other words, only use the console API in development code, NOT in production code since some vistors browsers will crash by using it.
If you absolutely must use console
in production code, wrap it in a function so no browsers would crash if the API doesn't exists.
function console() {
if(window.console) {
return window.console;
}
}
Usage:
JavaScript
console().log('something');
Achievements
170 Karma
5,039 Total ProTip Views

Kona
Have at least one original repo where CoffeeScript is the dominant language

Raven
Have at least one original repo where some form of shell script is the dominant language

24PullRequests Participant
Sent at least one pull request during the first 24 days of December 2013

Forked 50
Have a project with a thriving community of users that's been forked at least 50 times

Cub
Have at least one original jQuery or Prototype open source repo

Lemmings 100
Write something great enough to have at least 100 watchers of the project

Forked 20
Have an established project that's been forked at least 20 times

Forked
Have a project valued enough to be forked by someone else

Altruist
Increase developer well-being by sharing at least 20 open source projects

Walrus
The walrus is no stranger to variety. Use at least 4 different languages throughout all your repos

Charity
Fork and commit to someone's open source project in need

Lab
Have at least one original repo where C# is the dominant language

Nephila Komaci 3
Have at least three original repos where PHP is the dominant language

Nephila Komaci
Have at least one original repos where PHP is the dominant language
I understand that you prefer MIT or BSD but why should people choose MIT if that's not exactly what you want comparing to the GPL licence? It's all about how you want your work to be shared, right? For example, if you want people to share back into the open source community when making changes to your code, you should probably go with GPL since it's forcing people to share the changes they've made if the distribute something based on it.