-
Notifications
You must be signed in to change notification settings - Fork 2
taking it easy
#taking it easy
a lose set of modification to the core JavaScript syntax designed to make a developers life easier.
all modifications are of course compatible to the JavaScript syntax.
they usually are considered syntax errors in JavaScript.
##"string ##continuation"
Stability: 3 - Stable
there is no reason why strings should not be allowed to continue over several lines. thats why it is possible in promiseLand.
var s = "this
is
a
string";
var x = 'this is a string
as well';
be less annoyed when you have to create strings that contain line breaks.
##[function]
Stability: 3 - Stable
the function keyword is not syntactically necessary to identify a block of code as a function expression. you can simply leave it.
doStuff(){
};
var someFun = (){
doStuff();
};
concentrate on your functionality instead of getting annoyed by writing the keyword function for the 10 thousandth time.
Stability: 3 - Stable
simply want to avoid any errors but not actually handle them?
or want to catch all errors of your function without giving it extra indentation?
- you can use try on its own
try{
someDangerousFunction(); // we dont care about the error here
};
- you can use catch on its own
myFun(){
doStuff();
doOtherStuff();
catch(e){
// handle all the errors here
};
};
if you use catch alone, it implies a try block over the current block up to the last catch statement.
less type work and maybe more readable code when using error handling
next feature: class
found any errors?
missing something?
let me know