Skip to content

Instantly share code, notes, and snippets.

View benjamingr's full-sized avatar
🖊️
Limited availability.

Benjamin Gruenbaum benjamingr

🖊️
Limited availability.
View GitHub Profile

Here is some Code and words. This is more random wody stuff, some code suddenly a widd more some more Other Code which makes the above code seems Related although it is not.

Here is some Code and words. This is more random wody stuff, some code suddenly a widd more some more Other Code which makes the above code seems Related although it is not.

Here is some Code and words. This is more random wody stuff, some code suddenly a widd more some more Other Code which makes the above code seems Related although it is not.

RoomMeeting

Please suggest topics below in the comments.

Meeting will be held this Saturday in 19:00 GMT.

###Discussion relating to this

Who here feels that perma-banning okok for asking:

is it possible to cut photos on the fly with js?

link

Was justified?

Here is a solution using ES6 sets.
var a = new Set(Array1);
Array2.forEach(function(elem){
a.delete(elem);
});
return a;

Asking a Question

Hi, welcome to our chat room. We accept questions from people coming into the room.

When asking, the following will greatly increase your chance of getting an answer:

  • Create a self contained code example illustrating the issue. You can upload it to jsfiddle , codepen or jsbin.
  • If you paste code, format it by pressing Control+K or pressing the "Fixed Font" button. Code you put inside backticks is also formatted.
  • Make sure there are no name error or syntax errors.
"use strict";
function EventEmitter() {}
EventEmitter.prototype.on = EventEmitter.prototype.emit = function() {};

דברים שמפתחי JavaScript צריכים לדעת לווב.

  1. איך מבצעים בקשת AJAX לשרת
  2. מה זה AJAX
  3. איך אני מחזיר ערך מקריאת AJAX
  4. איך מבצעים איטרציה על עברי מערך
  5. איך מבצעים איטרציה על איברי אובייקט
  6. איך אני מוסיף פעולה ללחיצה על טאג HTML שרשמתי
  7. איך אני יוצר HTML חדש מJavaScript ומוסיף אותו לדף
  8. איך אני שומר מידע בJavaScript שהמשתמש יגש אליו פעם הבאה שהוא חוזר לדף

Traditionally, JavaScript code contains some sort of asynchronous logic either on the client side or on the server side.

This makes the try/catch construct non-practical for many real use cases because it can not catch errors caused by callbacks and/or other asynchronous operations involved. This is why we have common idioms like the (err,result) of NodeJS callbacks or reject in promises implementations and so on.

NodeJS also introduces domains which let you catch all errors that originated from a piece of code in a certain way.

ES6 Generators recently implemented in NodeJS allow us to do concurrency using coroutines. This allows for very nice code that's very readable in certain cases. The async_functions proposal is also very interesting solving the problem without needing a "runner" for the generator.

However, one issue arises from using generators for such concurrency. The current way try/catch works with generators does not give us a way to differentiate things like syntax errors from logic err