{"id":198212,"date":"2013-10-30T21:14:03","date_gmt":"2013-10-30T17:14:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=198212"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=198212","title":{"rendered":"<span class=\"post_title\">Matreshka.js \u2014 MK.Array<\/span>"},"content":{"rendered":"<div class=\"content html_format\">\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/196146\/\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/200078\/\">\u041d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/196886\/\">MK.Object<\/a><\/li>\n<li><b>MK.Array<\/b><\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445. <a href=\"http:\/\/habrahabr.ru\/post\/196886\/\">\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Matreshka.js \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <code>MK.Array<\/code>. \u0427\u0435\u043c \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432? \u041f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u043c. \u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f <code>MK.Array<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0443 \u00ab\u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e\u00bb \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0447\u0442\u043e \u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 <code>Array<\/code>, \u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  <b><code>MK.Array<\/code><\/b> \u2014 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043c\u0435\u0435\u0442:  <\/p>\n<ul>\n<li>\u0412\u0441\u0451, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 <code>Array<\/code><\/li>\n<li>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/li>\n<li>\u0423\u043c\u0435\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0430: \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/li>\n<\/ul>\n<p>  \u041a\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"javascript\">mkArray \t.on( 'push', function() { \t\talert( 'push' ); \t}) \t.push( 1, 2, 3, 4 ) \t.unshift( 0 ) \t.shift() \t.pop() \t.push( 5 ) \t.forEach( function() { ... } ) \t.sort() \t.reverse() ; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u0433\u0438\u0444\u043a\u0443 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u0435\u0440\u0438\u0438?<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/5c0\/b8b\/768\/5c0b8b768c3054e729da66e74c9f6870.gif\"\/><\/div>\n<\/div>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 <code>MK.Array<\/code> \u043d\u0430\u0434\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c 5 \u0432\u0435\u0449\u0435\u0439:<\/p>\n<p>  <b>0.<\/b> \u041c\u0435\u0442\u043e\u0434\u044b, \u043f\u0440\u0438\u0448\u0435\u0434\u0448\u0438\u0435 \u0438\u0437 <code>Array<\/code> \u0432 <code>MK.Array<\/code> \u043d\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u043d\u044b \u0437\u0430\u043d\u043e\u0432\u043e. <code>MK.Array<\/code> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e, \u0432\u043e \u043f\u0435\u0440\u0432\u044b\u0445, \u043a\u043e\u0434 \u043a\u043b\u0430\u0441\u0441\u0430 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u0435\u043d, \u0432\u043e-\u0432\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u0438\u0437\u0431\u0435\u0433\u0430\u0435\u043c \u0431\u0430\u0433\u043e\u0432 \u043d\u0435\u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u042d\u0442\u043e \u0442\u0430\u043a \u0436\u0435 \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 Internet Explorer 8, \u043f\u043e\u043a\u0430 \u0432\u044b \u043d\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435, \u0441\u043a\u0430\u0436\u0435\u043c, <a href=\"https:\/\/github.com\/kriskowal\/es5-shim\">es5-shim<\/a>. \u041f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043d\u0435\u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u043c\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0448\u0438\u0431\u043a\u0430, \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u0443 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0431\u044b\u043b \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d \u043f\u0440\u0438 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0430 <code>Array<\/code> \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0431\u043e\u0440\u043a\u0435 Chrome \u0438 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043d\u0430 MDN.<\/p>\n<p>  <b>1.<\/b> \u041c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442 \u0434\u0432\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u044f: <code>&quot;modify&quot;<\/code> \u0438 \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <code>.push<\/code> \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <code>&quot;modify&quot;<\/code>, \u043d\u043e \u0438 <code>&quot;push&quot;<\/code>.<\/p>\n<pre><code class=\"javascript\">var mkArray = new MK.Array; mkArray.on( 'push', function() { \talert( 'push' ); }); mkArray.on( 'modify', function() { \talert( 'modify' ); }); mkArray.push( 42 ); <\/code><\/pre>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:  <\/p>\n<ul>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#push\"><code>.push<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#pop\"><code>.pop<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#unshift\"><code>.unshift<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#shift\"><code>.shift<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#sort\"><code>.sort<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#reverse\"><code>.reverse<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#splice\"><code>.splice<\/code><\/a><\/li>\n<\/ul>\n<p>  <b>2.<\/b> \u0414\u043b\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0435\u0441\u044f \u0441 <code>silent<\/code>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u043d\u043e \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>silentPush<\/code> (\u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u043c\u044f \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u0441 \u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u0431\u0443\u043a\u0432\u044b).<\/p>\n<pre><code class=\"javascript\">var mkArray = new MK.Array; mkArray.silentPush( 42 ); <\/code><\/pre>\n<p>  \u0421\u043f\u0438\u0441\u043e\u043a \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u044f:  <\/p>\n<ul>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#silentPush\"><code>.silentPush<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#silentPop\"><code>.silentPop<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#silentUnshift\"><code>.silentUnshift<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#silentShift\"><code>.silentShift<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#silentSort\"><code>.silentSort<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#silentReverse\"><code>.silentReverse<\/code><\/a><\/li>\n<li><a href=\"http:\/\/finom.github.io\/matreshka\/docs\/Matreshka.Array.html#silentSplice\"><code>.silentSplice<\/code><\/a><\/li>\n<\/ul>\n<p>  <b>3.<\/b> \u041c\u0435\u0442\u043e\u0434 <code>.forEach<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0435 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e <code>Array<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 <code>undefined<\/code>, \u0432 <code>MK.Array<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0435\u0431\u044f:  <\/p>\n<pre><code class=\"javascript\">var mapped = mkArray \t.forEach( function() { \t\t... \t}) \t.forEach( function() { \t\t... \t}) \t.map( function() { \t\t... \t}) ; <\/code><\/pre>\n<p>  <b>4.<\/b> \u041c\u0435\u0442\u043e\u0434\u044b \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e <code>Array<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u044e\u0442 \u043c\u0430\u0441\u0441\u0438\u0432, \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u0432\u0442\u043e\u0440\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (<code>.push<\/code>, <code>.unshift<\/code>) \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (<code>.pop<\/code>, <code>.shift<\/code>), \u0432 <code>MK.Array<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0441\u0435\u0431\u044f. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 (\u0442\u043e, \u0447\u0442\u043e \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u043b\u043e). \u041c\u0435\u0442\u043e\u0434\u044b, \u043f\u0435\u0440\u0432\u0438\u0447\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e <code>.indexOf<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e, <code>.toString<\/code> \u2014 \u0441\u0442\u0440\u043e\u043a\u0443\u2026<\/p>\n<pre><code class=\"javascript\">mkArray \t.push( 1, 2, 3, 4 ) \t.unshift( 0 ) \t.shift() \t.pop() \t.push( 5 ) \t.forEach( function() { ... } ) \t.sort() \t.reverse() ; <\/code><\/pre>\n<p>  \u041a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 <code>.push<\/code>:  <\/p>\n<pre><code class=\"javascript\">var array = new Array( 1, 2, 3, 4 ), \tmkArray = new MK.Array( 1, 2, 3, 4 ), \tarrayLength, mkArrayLength;  arrayLength = array.push( 6, 7 );  mkArray.push( 6, 7 ); mkArrayLength = mkArray.length; <\/code><\/pre>\n<p>  <b>5.<\/b> \u041c\u0435\u0442\u043e\u0434\u044b-\u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b (<code>.forEach<\/code>, <code>.map<\/code>, <code>.filter<\/code>, &#8230;) \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0442 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0442\u0440\u0435\u0442\u044c\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0440\u043e\u0434\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432\u043e\u0441\u044c\u043c\u043e\u0433\u043e \u041e\u0441\u043b\u0430 \u043d\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>Array.prototype[ method ].apply<\/code> \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u0437\u0430\u043f\u0443\u0441\u043a \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<br \/>  1. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>MK.Array<\/code> \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>Array<\/code>.<br \/>  2. \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 <code>Array.prototype[ name ].apply( array, arguments );<\/code><br \/>  3. \u042d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 <code>MK.Array<\/code> \u043e\u0447\u0438\u0449\u0430\u0435\u0442\u0441\u044f \u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c <code>Array<\/code>.<\/p>\n<pre><code class=\"javascript\">mkArray.forEach( function( item, index, array ) { \tconsole.log( array === mkArray ); \/\/ false }); <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u0434\u043e\u0443\u043c\u0435\u043d\u0438\u0435 \u0443 \u043e\u043f\u044b\u0442\u043d\u044b\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432. \u041d\u0435 \u0441\u043f\u0435\u0448\u0438\u0442\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u0433\u043d\u0435\u0432\u043d\u044b\u0439 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439. \u0415\u0441\u043b\u0438 \u0425\u0430\u0431\u0440\u0443 \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0441\u0430\u043c\u043e\u0435 \u0433\u043b\u0430\u0432\u043d\u043e\u0435: \u043a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0430.<\/p>\n<h5>\u041d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435<\/h5>\n<p>  \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u043e-\u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u043b\u044e\u0431\u043e\u0439 \u043a\u043b\u0430\u0441\u0441, \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043e\u0442 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0438:  <\/p>\n<pre><code class=\"javascript\">var MyArray = Class({ \t'extends': MK.Array, \tconstructor: fucntion() { \t\tthis.initMK(); \t} }); <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 <code>.initMK<\/code>, \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u0440\u043e\u043c\u0435 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043f\u0441\u0435\u0432\u0434\u043e\u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0443 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u043f\u0440\u0438 \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0438.<\/p>\n<h5>\u041f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435<\/h5>\n<p>  <code>MK.Array<\/code> \u0441\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043e\u0442\u043e\u0432\u044b\u043c \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u043a\u043b\u0430\u0441\u0441\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u0442 \u0441\u0430\u0445\u0430\u0440\u0430 \u0432 \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0415\u0441\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u00ab\u043d\u043e\u00bb: \u043c\u0430\u0442\u0440\u0435\u0448\u043a\u043e-\u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0435 \u0443\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041f\u0440\u0438\u0432\u044f\u0437\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a \u0438\u043d\u0434\u0435\u043a\u0441\u0443 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>.bindElement<\/code> \u0432\u044b \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0441\u043c\u043e\u0436\u0435\u0442\u0435, \u043d\u043e, \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u044d\u0442\u043e \u0438\u043c\u0435\u0435\u0442 \u043c\u0430\u043b\u043e \u0441\u043c\u044b\u0441\u043b\u0430: \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441, \u0441\u043a\u0430\u0436\u0435\u043c, \u0435\u0441\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043c\u0435\u043d\u044f\u0442\u044c DOM \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043d\u0430\u0434\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>&quot;push&quot;<\/code> \u0438 <code>&quot;splice&quot;<\/code>, \u0432\u043e\u043f\u0440\u043e\u0441 \u0442\u043e\u043b\u044c\u043a\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e.<\/p>\n<p>  \u0413\u0438\u0444\u043a\u0430 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0441\u0442\u0430 \u2014 \u044d\u0442\u043e \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b (\u043f\u043e\u043a\u0430) <a href=\"http:\/\/finom.github.io\/matreshka\/examples\/js\/domarray.mk.js\">\u043d\u0435\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u043b\u0430\u0433\u0438\u043d\u0430 MK.DOMArray<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439, \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u044f \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0435\u043d\u044f\u0435\u0442 DOM. \u041f\u043b\u0430\u0433\u0438\u043d \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430, \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0438 \u0438 \u0434\u043b\u044f \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u0431\u043b\u0438\u0436\u0435 \u043a \u0438\u0434\u0435\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e DOM \u0434\u043e\u043b\u0436\u0435\u043d \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c\u0441\u044f \u0441\u0430\u043c, \u043a\u043e\u0433\u0434\u0430 \u0434\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f. \u041d\u043e \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u043d\u0430\u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0443\u0434\u0430\u0447\u043d\u044b\u043c, \u0447\u0442\u043e, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0434 \u043f\u043b\u0430\u0433\u0438\u043d\u0430 \u0432\u043e\u043b\u044c\u0451\u0442\u0441\u044f \u0432 \u043a\u043e\u0434 <code>MK.Array<\/code>. \u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0432 DOM \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b: \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u043e\u0432\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b, \u043f\u0440\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u2014 \u0443\u0434\u0430\u043b\u044f\u044e\u0442\u0441\u044f, \u043f\u0440\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u2014\u00a0\u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f. \u042d\u0442\u043e \u044f \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u043d\u0435 \u043f\u0435\u0440\u0435\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u0430\u043d\u043e\u0432\u043e, \u0430 \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u0430\u0442\u0440\u0435\u0448\u043a\u043e-\u043c\u0430\u0441\u0441\u0438\u0432 (\u0430 \u0442\u043e\u0447\u043d\u0435\u0435 \u0435\u0433\u043e \u043f\u043e\u0442\u043e\u043c\u043e\u043a: <code>MK.DOMArray<\/code>) \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c Collection \u0432 Backbone, \u0430 \u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u2014 \u0430\u043d\u0430\u043b\u043e\u0433\u043e\u043c Model. \u041f\u0440\u0438\u043c\u0435\u0440 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/jsbin.com\/aZEseWE\/16\/\">jsbin.com\/aZEseWE\/16\/<\/a> (\u0438\u043c\u0435\u043d\u043d\u043e \u0441 \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0430\u0441\u044c \u0433\u0438\u0444\u043a\u0430). \u0410 \u0432\u043e\u0442 \u0437\u0434\u0435\u0441\u044c: <a href=\"http:\/\/jsbin.com\/eQomoJe\/9\/\">jsbin.com\/eQomoJe\/9\/<\/a> \u0431\u043e\u043b\u0435\u0435 \u0430\u0441\u043a\u0435\u0442\u0438\u0447\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442. \u0412 \u043d\u0435\u043c \u043d\u0435\u0442 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u042f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0438\u0442\u0430\u044e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431, \u043d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u043a\u0430\u0436\u0443\u0449\u0443\u044e\u0441\u044f \u0438\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c.<\/p>\n<p>  <code>MK.DOMArray<\/code> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u0430\u043a\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c: \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (\u0432 \u043d\u0430\u0447\u0430\u043b\u043e, \u043a\u043e\u043d\u0435\u0446, \u0441\u0435\u0440\u0435\u0434\u0438\u043d\u0443\u2026 \u0431\u0435\u0437 \u0440\u0430\u0437\u043d\u0438\u0446\u044b) \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u0435\u0433\u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043c\u0435\u0442\u043e\u0434 <code>.renderer<\/code> \u0438, \u0435\u0441\u043b\u0438 \u043e\u043d \u0435\u0441\u0442\u044c, \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 (\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0438\u0437 HTML \u0441\u0442\u0440\u043e\u043a\u0438) \u043a \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u043c\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0443 (\u043a \u0435\u0433\u043e <code>&quot;__this__&quot;<\/code>) \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043d\u0430 \u044d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 <code>&quot;render&quot;<\/code>.   <\/p>\n<pre><code class=\"javascript\">var Example = Class({ \t'extends': MK.DOMArray, \tconstructor: function() { \t\tthis \t\t\t\/\/ \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0443 \t\t\t.initMK() \t\t\t\/\/ \u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \t\t\t.bindElement( this, 'table tbody' ) \t\t; \t}, \trenderer: function( object ) { \t\t\/\/ \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043f\u0443\u0441\u0442\u044b\u043c\u0438 \u0442\u0435\u0433\u0430\u043c\u0438. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044f\u0447\u0435\u0435\u043a \u043e\u0431\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u0440\u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0435 \t\treturn '&lt;tr&gt;&lt;td class=&quot;a&quot;&gt;&lt;\/td&gt;&lt;td class=&quot;b&quot;&gt;&lt;\/td&gt;&lt;td class=&quot;c&quot;&gt;&lt;\/td&gt;&lt;\/tr&gt;'; \t} }); <\/code><\/pre>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0435\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043b\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u044f <code>&quot;render&quot;<\/code> \u0438 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043d\u0443\u0442\u0440\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u043a <code>&quot;__this__&quot;<\/code>.  <\/p>\n<pre><code class=\"javascript\">var ExampleObject = Class({ \t'extends': MK.Object, \tconstructor: function( o ) { \t\tthis \t\t\t.initMK() \t\t\t.jset( o ) \t\t\t\/\/ MK.DOMArray \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 render \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u043e\u0442\u0440\u0435\u043d\u0434\u0435\u0440\u0435\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043e\u0431\u044a\u0435\u043a\u0442\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \t\t\t.on( 'render', function() { \t\t\t\t\/\/ this \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0435 \t\t\t\t\/\/ \u043f\u043e\u0441\u043b\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \t\t\t\tthis.bindElement({ \t\t\t\t\ta: this.$( '.a' ), \t\t\t\t\tb: this.$( '.b' ), \t\t\t\t\tc: this.$( '.c' ) \t\t\t\t}, MK.htmlp ); \t\t\t}) \t\t; \t} }); <\/code><\/pre>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0434\u0435\u044f<\/b><\/p>\n<div class=\"spoiler_text\">\u0417\u0434\u0435\u0441\u044c \u0442\u0430\u043a \u0438 \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0433\u0438\u043d, \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441 \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c\u0438. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"javascript\">var table = MK.Table({ \ttable: '.my-table' \trows: [{ \t\ttitle: 'A', \t\tkey: 'a' \t}, { \t\ttitle: 'B', \t\tkey: 'b' \t}] });  table.push({ \ta: 'Fuck', \tb: 'Yeah' }); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<h4>\u0412 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u0435 \u0446\u0438\u043a\u043b\u0430<\/h4>\n<p>  \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0430 \u2014 \u044d\u0442\u043e \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439, \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438 \u0434\u0430\u043b\u044c\u0448\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f. \u041d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0443\u0440\u043e\u0432\u043d\u044f \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u0430, \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u0430 \u0432 \u0438\u0437\u0443\u0447\u0435\u043d\u0438\u0438 \u0438, \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u043d\u0430\u0447\u0430\u043b\u043e\u043c \u043f\u0440\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0435 \u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u043e\u0432\u0438\u0447\u043a\u0430\u043c\u0438. \u041a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0441\u0442\u044c \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u043e\u0441\u0442\u044c \u0434\u0430\u0451\u0442 \u043a\u0443\u0447\u0443 \u0438\u0434\u0435\u0439 \u0434\u043b\u044f \u043f\u043b\u0430\u0433\u0438\u043d\u043e\u0432 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0439. \u0421\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c, \u0431\u0443\u0434\u0435\u0442 \u0443\u0431\u0440\u0430\u043d\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u043e\u0442 jQuery, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 Internet Explorer 8, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435\u2026<\/p>\n<p>  \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0432\u0441\u0435\u043c \u0434\u043e\u0431\u0440\u0430.    \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\/198212\/\"> http:\/\/habrahabr.ru\/post\/198212\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">\n<ul>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/196146\/\">\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/200078\/\">\u041d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435<\/a><\/li>\n<li><a href=\"http:\/\/habrahabr.ru\/post\/196886\/\">MK.Object<\/a><\/li>\n<li><b>MK.Array<\/b><\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e \u0432\u0441\u0435\u0445. <a href=\"http:\/\/habrahabr.ru\/post\/196886\/\">\u041f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u044c\u044e<\/a> \u044f \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b \u043d\u0430 \u0442\u043e\u043c, \u0447\u0442\u043e \u043d\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0445. \u041c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 Matreshka.js \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u043a\u043b\u0430\u0441\u0441\u0430 <code>MK.Array<\/code>. \u0427\u0435\u043c \u043e\u043d\u0438 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432? \u041f\u043e\u0447\u0442\u0438 \u043d\u0438\u0447\u0435\u043c. \u041f\u0440\u043e\u0442\u043e\u0442\u0438\u043f <code>MK.Array<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0443 \u00ab\u0442\u0440\u0430\u0434\u0438\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e\u00bb \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0442\u0435 \u0436\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u0447\u0442\u043e \u0438 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 <code>Array<\/code>, \u0430 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0435\u0439.<\/p>\n<p>  <b><code>MK.Array<\/code><\/b> \u2014 \u044d\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u0441\u0442\u0435\u0440\u043e\u0438\u0434\u0430\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043c\u0435\u0435\u0442:  <\/p>\n<ul>\n<li>\u0412\u0441\u0451, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 <code>Array<\/code><\/li>\n<li>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f \u043f\u0440\u0438 \u043c\u043e\u0434\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438<\/li>\n<li>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0446\u0435\u043f\u043e\u0447\u0435\u0447\u043d\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u0430\u043c, \u0433\u0434\u0435 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/li>\n<li>\u0423\u043c\u0435\u0435\u0442 \u0442\u043e, \u0447\u0442\u043e \u0443\u043c\u0435\u0435\u0442 \u041c\u0430\u0442\u0440\u0435\u0448\u043a\u0430: \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0441\u043e\u0431\u044b\u0442\u0438\u044f<\/li>\n<\/ul>\n<p>  \u041a\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"javascript\">mkArray \t.on( 'push', function() { \t\talert( 'push' ); \t}) \t.push( 1, 2, 3, 4 ) \t.unshift( 0 ) \t.shift() \t.pop() \t.push( 5 ) \t.forEach( function() { ... } ) \t.sort() \t.reverse() ; <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u0433\u0438\u0444\u043a\u0443 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0441\u0435\u0440\u0438\u0438?<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habr.habrastorage.org\/post_images\/5c0\/b8b\/768\/5c0b8b768c3054e729da66e74c9f6870.gif\"\/><\/div>\n<\/div>\n<p>  <\/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-198212","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198212","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=198212"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/198212\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=198212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=198212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=198212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}