Skip to content

Instantly share code, notes, and snippets.

Tobias Vetter tbsvttr

Block or report user

Report or block tbsvttr

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
View var.js
var name = 'Tobias';
function nameGiver () {
var myName = 'Alexander';
return myName;
}
console.log(name); // Tobias
console.log(nameGiver()); // Alexander
console.log(myName); // Reference error, because myName is private to the function nameGiver
View string_literals.js
// Usage of quotes as wrappers of string literals an within those string literals
var name = 'Tobias'; // String literal wrapped in single quotes.
var planet = "Earth"; // String literal wrapped in double quotes.
// Usage of single quotes within a string literal wrapped in double quotes.
var firstQuote = "They said the product is 'good'.";
// Usage of double quotes within a string literal wrapped in single quotes.
var secondQuote = 'They said the product is "good".';
View reserved_words.js
// Source: https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Lexical_grammar#Keywords
// Keywords ECMAScript 2015
break
case
catch
class
const
continue
View comments.js
// line comment
var name = 'Tobias'; // line comment
// var name = 'Tobias';
/*
block
You can’t perform that action at this time.