{"id":228819,"date":"2014-07-06T20:01:02","date_gmt":"2014-07-06T16:01:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=228819"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=228819","title":{"rendered":"<span class=\"post_title\">Deb.js: \u0441\u0430\u043c\u044b\u0439 \u043a\u0440\u043e\u0445\u043e\u0442\u043d\u044b\u0439 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a \u0432 \u043c\u0438\u0440\u0435<\/span>"},"content":{"rendered":"<div class=\"content html_format\">     \t\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u00abDeb.js: the Tiniest Debugger in the World\u00bb, Krasimir Tsonev<\/p>\n<p>  \u041c\u044b, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434. \u041d\u043e \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u043a\u043e\u0434. \u041c\u044b \u0442\u0440\u0430\u0442\u0438\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0443\u0441\u0438\u043b\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u0435\u043b\u0430\u044e\u0442 \u0442\u043e \u0447\u0442\u043e \u0434\u043e\u043b\u043d\u044b \u0434\u0435\u043b\u0430\u0442\u044c. \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u043c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0427\u0442\u043e\u0431\u044b \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140464219406812&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Fgithub.com%2Fkrasimir%2Fdeb.js&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Deb.js\">Deb.js<\/a>, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e JavaScript \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440<\/h4>\n<p>  \u041d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0441 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c JavaScript \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c. \u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u043e\u0440\u043c\u0443 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438 \u0438 \u043a\u043d\u043e\u043f\u043a\u043e\u0439. \u041f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043a\u043d\u043e\u043f\u043a\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0431\u0443\u0434\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u0412\u043e\u0442 \u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b:<\/p>\n<pre><code class=\"html\">&lt;form&gt;     &lt;label&gt;Name:&lt;\/label&gt;     &lt;input type=&quot;text&quot; name=&quot;name&quot; \/&gt;     &lt;label&gt;Address:&lt;\/label&gt;     &lt;input type=&quot;text&quot; name=&quot;address&quot; \/&gt;     &lt;input type=&quot;button&quot; value=&quot;register&quot; \/&gt; &lt;\/form&gt; &lt;div data-element=&quot;output&quot;&gt;&lt;\/div&gt; <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c jQuery \u0434\u043b\u044f DOM \u0432\u044b\u0431\u043e\u0440\u043e\u043a \u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u041c\u044b \u043e\u0431\u0435\u0440\u043d\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c:<\/p>\n<pre><code class=\"javascript\">var Module = {     collectData: function(cb) {         var name = $('[name=&quot;name&quot;]').val();         var address = $('[name=&quot;address&quot;]').val();         if(name != '' && address != '') {             cb(null, { name: name, address: address });         } else {             cb({msg: 'Missing data'});         }     },     error: function(err) {         $('[data-element=&quot;output&quot;]').html(err.msg);     },     success: function(data) {         $('[data-element=&quot;output&quot;]').html('Hello ' + data.name + '!');     } } <\/code><\/pre>\n<p>  \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>collectData<\/code> \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043b\u0435\u0439 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0432\u0432\u0435\u043b \u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0447\u0435\u0433\u043e-\u043d\u0438\u0431\u0443\u0434\u044c. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u0441 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c \u043a\u043e\u0440\u043e\u0442\u043a\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0441 null \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0435 \u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u0430\u043a \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440. \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439 \u043c\u043e\u0434\u0443\u043b\u044c, \u0434\u043e\u043b\u0436\u0435\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c, \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442 \u043e\u0448\u0438\u0431\u043a\u0438. \u0415\u0441\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430, \u0442\u043e\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<pre><code class=\"javascript\">$('[value=&quot;register&quot;]').on('click', function() {     Module.collectData(function(err, data) {         if(typeof err === 'object') {             Module.error(err);         } else {             Module.success(data);         }     }); }); <\/code><\/pre>\n<p>  \u041c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 <code>err<\/code> \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c \u0438 \u0435\u0441\u043b\u0438 \u0434\u0430, \u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435. \u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c\u0441\u044f \u043a \u043a\u043e\u0434\u0443, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u043a\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0432\u0441\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/69e\/3c7\/742\/69e3c77422e7afa8f0e25673e1674266.gif\" alt=\"image\"\/><\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u044b, \u043d\u0430\u0448 \u0441\u043a\u0440\u0438\u043f\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043a\u0430\u043a \u0438 \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c. \u041f\u043e\u0434 \u0444\u043e\u0440\u043c\u043e\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435 \u0432\u0432\u0435\u0434\u0435\u043d\u044b. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u0415\u0441\u043b\u0438 \u043c\u044b \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043c \u043f\u043e\u043b\u044f \u0438 \u043d\u0430\u0436\u043c\u0435\u043c \u043a\u043d\u043e\u043f\u043a\u0443, \u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435: <\/p>\n<blockquote><p>Uncaught TypeError: Cannot read property &#8216;msg&#8217; of null<\/p><\/blockquote>\n<p> \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0436\u0435 \u0432\u044b\u0441\u043b\u0435\u0434\u0438\u043c \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u044d\u0442\u0443 \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<h4>\u0422\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434<\/h4>\n<p>  \u0412 Google Chrome \u0435\u0441\u0442\u044c \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u043a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u043e \u043e\u0448\u0438\u0431\u043a\u0435 \u0438 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0435\u0435 \u0441\u0442\u044d\u043a\u0442\u0440\u0435\u0439\u0441. \u041c\u043e\u0436\u0435\u043c \u0434\u0430\u0436\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u043c\u0435\u0441\u0442\u0443, \u0433\u0434\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u044b\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/e56\/83d\/a44\/e5683da44ffa20a63e227f720348f93b.gif\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435 \u0447\u0442\u043e \u043c\u0435\u0442\u043e\u0434 <code>error<\/code> \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e, \u0447\u0442\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f <code>null<\/code>. \u0418 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, <code>null<\/code> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 <code>msg<\/code>. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u0431\u0440\u0430\u0443\u0437\u0435\u0440 \u0432\u044b\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443. \u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>error<\/code> \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u043e\u0434\u043d\u043e\u043c \u043c\u0435\u0441\u0442\u0435. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0442\u043e\u0447\u043a\u0443 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/955\/434\/6f8\/9554346f8a53dea7332d4986fc3e7ada.gif\" alt=\"image\"\/><\/p>\n<p>  \u041f\u043e\u0445\u043e\u0436\u0435 \u0447\u0442\u043e \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 <code>data<\/code> \u0438 <code>error<\/code> \u0440\u0430\u0432\u0435\u043d <code>null<\/code>, \u0438 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0433\u0434\u0435-\u0442\u043e \u0432 <code>if<\/code> \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0438. \u0414\u043e\u0431\u0430\u0432\u0438\u043c <code>console.log<\/code> \u0438 \u0443\u0432\u0438\u0434\u0438\u043c, \u0434\u0432\u0438\u0436\u0435\u043c\u0441\u044f \u043b\u0438 \u043c\u044b \u0432 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u043c \u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0438:  <\/p>\n<pre><code class=\"javascript\">Module.collectData(function(err, data) {     console.log(typeof err);     if(typeof err === 'object') {         Module.error(err);     } else {         Module.success(data);     } }); <\/code><\/pre>\n<p>  \u0418 \u0432 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, <code>typeof err<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>object<\/code>. \u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043c\u044b \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/dea\/3d8\/0f4\/dea3d80f4362129297ab180cf40a2be1.gif\" alt=\"image\"\/><\/p>\n<p>  \u0418 \u0432\u0443\u0430\u043b\u044f, \u043c\u044b \u043d\u0430\u0448\u043b\u0438 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443. \u041d\u0430\u043c, \u0432\u0441\u0435\u0433\u043e-\u0442\u043e, \u043d\u0443\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <code>if<\/code> \u043d\u0430 <code>if (err)<\/code> \u0438 \u043d\u0430\u0448 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u043a\u0430\u043a \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c.<\/p>\n<p>  \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0438\u043d\u043e\u0433\u0434\u0430 \u0442\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0443\u0442\u043e\u043c\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043f\u0440\u0438\u0447\u0438\u043d\u0430\u043c:<\/p>\n<ul>\n<li>\u041a\u0430\u043a \u0432\u044b \u0432\u0438\u0434\u0435\u043b\u0438, \u043c\u044b \u043f\u0440\u0438\u0431\u0435\u0433\u043b\u0438 \u043a \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0422\u0430\u043a \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0430. \u041c\u044b \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440 \u043a\u043e\u0434\u0430 \u0438 \u0432 \u043f\u0430\u043d\u0435\u043b\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0438 Chrome. \u042d\u0442\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0441\u0442, \u0433\u0434\u0435 \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u043d\u0430\u0441\u043a\u0443\u0447\u0438\u0442\u044c.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043c\u043d\u043e\u0433\u043e \u0434\u0430\u043d\u043d\u044b\u0445 \u0437\u0430\u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u044d\u0442\u043e \u0442\u043e\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0441\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439. \u0412\u0440\u0435\u043c\u0435\u043d\u0430\u043c\u0438, \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0442\u0440\u0443\u0434\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e.<\/li>\n<li>\u0422\u0430\u043a\u0436\u0435 \u044d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u043d\u0435 \u043f\u043e\u043c\u043e\u0436\u0435\u0442, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c. \u0427\u0430\u0449\u0435 \u0432\u0441\u0435\u0433\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0437\u043d\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  \u0418\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0435\u0451 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u2014 \u0431\u0435\u0441\u0446\u0435\u043d\u043d\u043e, \u043d\u043e Chrome \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0437\u043d\u0430\u0442\u044c, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c. \u041a\u0430\u043a \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0434\u0432\u0430\u0436\u0434\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e <code>if<\/code>. \u041d\u0435 \u0431\u044b\u043b\u043e \u0431\u044b \u043b\u0443\u0447\u0448\u0435, \u0435\u0441\u043b\u0438 \u0431\u044b \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0439 \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430? \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u0438 \u043e\u0442\u043b\u0430\u0434\u0447\u0438\u043a, \u043d\u043e \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u043d\u0441\u043e\u043b\u0438? \u0422\u0430\u043a \u0432\u043e\u0442, <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140464905858715&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Fgithub.com%2Fkrasimir%2Fdeb.js&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Deb.js\">Deb.js<\/a> \u0438 \u0435\u0441\u0442\u044c \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0432\u043e\u043f\u0440\u043e\u0441.<\/p>\n<h4>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c Deb.js<\/h4>\n<p>  <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140464923482017&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Fgithub.com%2Fkrasimir%2Fdeb.js&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Deb.js\">Deb.js<\/a> \u044d\u0442\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0439 \u043a\u0443\u0441\u043e\u0447\u0435\u043a JavaScript \u043a\u043e\u0434\u0430, 1,5\u043a\u0431 \u0432 \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c. \u041e\u043d \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d \u043a \u043b\u044e\u0431\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442:<\/p>\n<ul>\n<li>\u0412\u0440\u0435\u043c\u044f \u0438 \u043c\u0435\u0441\u0442\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/li>\n<li>\u0422\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u0442\u0435\u043a\u0430<\/li>\n<li>\u041e\u0442\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0438 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0442<\/li>\n<\/ul>\n<p>  \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0437\u0433\u043b\u044f\u043d\u0435\u043c, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 Deb.js:<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/7ee\/18d\/979\/7ee18d9790b7c283487aedb3b8ff7bcd.gif\" alt=\"image\"\/><\/p>\n<p>  \u041c\u044b, \u0432 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438, \u0432\u0438\u0434\u0438\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u0442\u0435\u043a\u0430. \u041d\u043e \u0437\u0430\u043c\u0435\u0442\u044c\u0442\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0430\u0434 \u043d\u0430\u0448\u0438\u043c \u043a\u043e\u0434\u043e\u043c, \u043d\u0430\u0445\u043e\u0434\u0438\u043c, \u0433\u0434\u0435 \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c <code>.deb()<\/code> \u043f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u0442\u0438\u043f <code>err<\/code> \u043f\u043e\u043c\u0435\u0449\u0435\u043d \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043d\u0430\u043c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u044d\u0442\u043e \u0438\u0441\u043a\u0430\u0442\u044c. \u0412\u043e\u0437\u0432\u0440\u0430\u0442 \u0442\u0430\u043a\u0436\u0435 \u0441\u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u0430\u043d \u0438 \u0440\u0430\u0441\u043a\u0440\u0430\u0448\u0435\u043d. \u041a\u0430\u0436\u0434\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0435\u043c \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043f\u0435\u0447\u0430\u0442\u0430\u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0438\u0441\u043f\u0440\u0430\u0432\u0438\u043c \u043d\u0430\u0448 \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u043c \u0434\u0440\u0443\u0433\u043e\u0439 <code>deb()<\/code>, \u0447\u0442\u043e\u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u043a\u0430\u043a \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/getpro\/habr\/post_images\/753\/d77\/49d\/753d7749d800de0be660c8da413e85b1.gif\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441\u0442\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u0442\u044c \u0438\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u0438 \u043e\u043a\u0440\u0430\u0448\u0435\u043d\u044b \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430. \u041c\u044b \u0432\u0438\u0434\u0438\u043c \u0438\u0445\u043d\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0432\u044b\u0432\u043e\u0434 \u0438 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0415\u0441\u043b\u0438 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>console.log<\/code>, \u043c\u044b \u0443\u0432\u0438\u0434\u0438\u043c \u0438\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043d\u0430 \u043c\u0435\u0441\u0442\u0435 \u0433\u0434\u0435 \u043e\u043d\u0438 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0442. \u0415\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0433\u043e \u0438\u0445 \u0440\u0430\u0441\u043f\u043e\u0437\u043d\u0430\u0432\u0430\u043d\u0438\u044f.<\/p>\n<p>  \u0417\u0430\u043c\u0435\u0442\u044c\u0442\u0435, \u0447\u0442\u043e \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <code>debc<\/code>, \u0430 \u043d\u0435 <code>deb<\/code>. \u042d\u0442\u043e \u0442\u0430 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0441\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u043c \u0432\u044b\u0432\u043e\u0434\u043e\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u043d\u0430\u0447\u043d\u0435\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140465269518620&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Fgithub.com%2Fkrasimir%2Fdeb.js&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Deb.js\">Deb.js<\/a>, \u0432\u044b \u043e\u0447\u0435\u043d\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u0435, \u0447\u0442\u043e \u0432\u0430\u043c \u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0443\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438.<\/p>\n<h4>\u041a\u0430\u043a \u0431\u044b\u043b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043d Deb.js<\/h4>\n<p>  \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0431\u044b\u043b\u0430 \u0438\u0437\u043b\u043e\u0436\u0435\u043d\u0430 \u0432 \u0441\u0442\u0430\u0442\u044c\u0435<a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140465344387923&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Ftwitter.com%2Frem&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Remy%20Sharp\">\u0420\u0435\u043c\u0438 \u0428\u0430\u0440\u043f\u0430(Remy Sharp)<\/a> \u043e \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u0438 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 <code>console.log<\/code>. \u041e\u043d \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043e\u0448\u0438\u0431\u043a\u0443 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043e\u0442\u0442\u0443\u0434\u0430 \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443:  <\/p>\n<pre><code class=\"javascript\">['log', 'warn'].forEach(function(method) {   var old = console[method];   console[method] = function() {     var stack = (new Error()).stack.split(\/\\n\/);     \/\/ Chrome includes a single &quot;Error&quot; line, FF doesn't.     if (stack[0].indexOf('Error') === 0) {       stack = stack.slice(1);     }     var args = [].slice.apply(arguments).concat([stack[1].trim()]);     return old.apply(console, args);   }; }) <\/code><\/pre>\n<p>  \u041e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140465366303625&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=http%3A%2F%2Fremysharp.com%2F2014%2F05%2F23%2Fwhere-is-that-console-log%2F&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=on%20Remy%27s%20blog\">\u0432 \u0431\u043b\u043e\u0433\u0435 \u0420\u0435\u043c\u0438<\/a>. \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0432 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0438 Node.js.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0438\u043c\u0435\u044f \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u0442\u0435\u043a\u0430, \u043c\u043d\u0435 \u043a\u0430\u043a-\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u043d\u0435\u0434\u0440\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0438 \u043a\u043e\u043d\u0435\u0446 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0422\u043e\u0433\u0434\u0430-\u0442\u043e \u043c\u043d\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043b\u0441\u044f \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0432 <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140465393020327&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=http%3A%2F%2Femberjs.com%2Fguides%2Fobject-model%2Fcomputed-properties%2F&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Ember%27s%20computed%20properties\">\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u0445 Ember&#8217;\u0430<\/a>. \u042d\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u0437\u0430\u043f\u0430\u0442\u0447\u0438\u0442\u044c <code>Function.prototype<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"javascript\">Function.prototype.awesome = function() {     var original = this;     return function() {         console.log('before');         var args = Array.prototype.slice.call(arguments, 0);         var res = original.apply(this, args);         console.log('after');         return res;     } }   var doSomething = function(value) {     return value * 2; }.awesome(); console.log(doSomething(42)); <\/code><\/pre>\n<p>  \u041a\u043b\u044e\u0447\u0435\u0432\u043e\u0435 \u0441\u043b\u043e\u0432\u043e <code>this<\/code> \u0432 \u043d\u0430\u0448\u0435\u043c \u043c\u0435\u0442\u043e\u0434\u0435, \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0441\u044f, \u043f\u043e\u0437\u0436\u0435, \u043a\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u044d\u0442\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f, \u044d\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0434\u043e \u0438 \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f. \u0412 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u043c\u044b \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043d\u0430\u0448\u0443 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u043a\u0430\u043a \u043f\u0440\u043e\u043a\u0441\u0438. \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 <code>.apply(this, args)<\/code> \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0418 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0435 \u0420\u0435\u043c\u0438, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u0440\u0430\u0441\u0441\u0438\u0440\u043e\u0432\u043a\u0443 \u0441\u0442\u0435\u043a\u0430.<\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140466164527729&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Fgithub.com%2Fkrasimir%2Fdeb.js&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Deb.js\">Deb.js<\/a> \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043a\u043e\u0440\u0430\u0446\u0438\u044f. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 <code>console.group<\/code> \u0438 <code>console.groupEnd<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0443\u043b\u0443\u0447\u0448\u0430\u044e\u0442 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u043b\u043e\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438. Chrome \u0434\u0430\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0440\u0430\u0441\u043a\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430.<\/p>\n<h4>\u0418\u0442\u043e\u0433<\/h4>\n<p>  \u042f \u0432\u0435\u0440\u044e \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u0411\u0440\u0430\u0443\u0437\u0435\u0440\u044b \u044d\u0442\u043e \u0443\u043c\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u044b\u0435 \u0443\u043c\u043d\u044b\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438, \u043d\u043e \u0438\u043d\u043e\u0433\u0434\u0430 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u0447\u0442\u043e \u0431\u043e\u043b\u044c\u0448\u0435\u0435. <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140466204456131&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Fgithub.com%2Fkrasimir%2Fdeb.js&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Deb.js\">Deb.js<\/a> \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f, \u043a\u0430\u043a \u043a\u0440\u043e\u0448\u0435\u0447\u043d\u0430\u044f \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u043e\u043c\u043e\u0433\u043b\u0430 \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u043c\u043d\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u0438. \u042d\u0442\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435, \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430. \u041d\u0435 \u0441\u0442\u0435\u0441\u043d\u044f\u0439\u0442\u0435\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c issues \u0438 pull request&#8217;\u044b.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.      \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/228819\/\"> http:\/\/habrahabr.ru\/post\/228819\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">     \t\u041f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0430\u0442\u044c\u0438 \u00abDeb.js: the Tiniest Debugger in the World\u00bb, Krasimir Tsonev<\/p>\n<p>  \u041c\u044b, \u043a\u0430\u043a \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438, \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434. \u041d\u043e \u043c\u044b \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043b\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u043a\u043e\u0434. \u041c\u044b \u0442\u0440\u0430\u0442\u0438\u043c \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0443\u0441\u0438\u043b\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0443\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u043d\u0430\u0448\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0434\u0435\u043b\u0430\u044e\u0442 \u0442\u043e \u0447\u0442\u043e \u0434\u043e\u043b\u043d\u044b \u0434\u0435\u043b\u0430\u0442\u044c. \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0437\u043d\u0435\u043d\u043d\u044b\u043c. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u043c\u044b \u043d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b. \u0427\u0442\u043e\u0431\u044b \u0441\u043f\u0440\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u043e\u0439, \u0441\u0435\u0433\u043e\u0434\u043d\u044f\u0448\u043d\u044f\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <a href=\"http:\/\/api.viglink.com\/api\/click?format=go&amp;jsonp=vglnk_jsonp_140464219406812&amp;key=be398d023a2fd4754907632fc9c47398&amp;libId=e9cf5217-dcda-4424-a37d-db5a4a2caa82&amp;loc=http%3A%2F%2Fcode.tutsplus.com%2Ftutorials%2Fdebjs-the-tiniest-debugger-in-the-world--cms-21565&amp;v=1&amp;out=https%3A%2F%2Fgithub.com%2Fkrasimir%2Fdeb.js&amp;ref=http%3A%2F%2Fhabrahabr.ru%2Fpost%2F228757%2F&amp;title=Deb.js%3A%20the%20Tiniest%20Debugger%20in%20the%20World%20-%20Tuts%2B%20Code%20Tutorial&amp;txt=Deb.js\">Deb.js<\/a>, \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0443\u044e JavaScript \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438 \u043e\u0442\u043b\u0430\u0434\u043a\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-228819","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228819","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=228819"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/228819\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=228819"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=228819"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=228819"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}