{"id":195816,"date":"2013-10-01T10:10:04","date_gmt":"2013-10-01T06:10:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=195816"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=195816","title":{"rendered":"<span class=\"post_title\">\u0421\u0445\u0435\u043c\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 javascript \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u043b\u0438 C-style \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u044b \u0431\u0435\u0437 \u0442\u044f\u0436\u0451\u043b\u043e\u0432\u0435\u0441\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043e\u0434\u0438\u043d, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439, \u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442.<\/p>\n<pre><code class=\"javascript\">function set(name, value){     if(value == undefined){         value = name;     }     ... } <\/code><\/pre>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u0442\u0441\u044f, \u0435\u0441\u043b\u0438 \u0434\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043c\u043e\u0433\u0443\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c. \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430. \u0422\u0438\u043f\u0438\u0447\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u044d\u0442\u043e \u043a\u043e\u043b\u0431\u0435\u043a, \u0430 \u043f\u0440\u0435\u0434\u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043d\u0435\u043a\u0430\u044f \u043e\u043f\u0446\u0438\u044f \u0438\u043b\u0438 \u043d\u0430\u0431\u043e\u0440 \u043e\u043f\u0446\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u0435\u0442\u043e\u0434 send \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442 \u043d\u0435\u043a\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0435\u043a\u043e\u0435\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0430\u0442\u0443. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0435, \u043d\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0443\u0442\u043e\u0447\u043d\u0438\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0431\u043e\u0440\u0430 \u043e\u043f\u0446\u0438\u0439 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u043a\u043e\u043b\u0431\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u0437\u043e\u0432\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430.<\/p>\n<pre><code class=\"javascript\">function send(data){ \tif(arguments[1] instanceof Function){ \t\tvar callback = arguments[1]; \t\tvar options = null; \t} \telse if(arguments[2] instanceof Function){ \t\tvar callback = arguments[2]; \t\tvar options = arguments[1]; \t}     ...\t } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0435\u043c \u0435\u0449\u0435. \u0410\u0434\u0440\u0435\u0441\u0430\u0442 \u0443\u0436\u0435 \u043d\u0435 \u043d\u0435\u043a\u0438\u0439, \u0435\u0433\u043e \u043d\u0430\u0434\u043e \u0443\u0442\u043e\u0447\u043d\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 id \u0438 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u044d\u0442\u0438\u043c \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u043f\u0430\u0447\u043a\u0443 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0440\u0430\u0437\u043d\u044b\u043c \u0430\u0434\u0440\u0435\u0441\u0430\u0442\u0430\u043c. \u0427\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c? \u041b\u043e\u0433\u0438\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0437\u0430\u0442\u043e\u0447\u0435\u043d\u0430 \u043f\u043e\u0434 \u043d\u0430\u0448, \u043f\u043e\u0447\u0442\u0438 \u0434\u0435\u0442\u0435\u0440\u043c\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439, \u043d\u0430\u0431\u043e\u0440 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443, \u043e\u0441\u043e\u0431\u043e \u043d\u0435 \u0432\u0434\u0430\u0432\u0430\u044f\u0441\u044c \u0432 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0438 (\u0442.\u043a. \u043c\u044b \u0443\u0436\u0435 \u0437\u0430\u0431\u044b\u043b\u0438 \u0447\u0442\u043e \u0442\u0430\u043c \u043f\u043e\u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e) \u043e\u0431\u043e\u0440\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0435\u0451 (\u043b\u043e\u0433\u0438\u043a\u0443) \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0438 \u043a\u043b\u0430\u0434\u0451\u043c \u0432\u044b\u0437\u043e\u0432 \u0432 \u0446\u0438\u043a\u043b. \u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u044f\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432,<br \/>  \u0430 \u0441 \u043d\u0430\u0431\u043e\u0440\u043e\u043c \u0432\u043d\u0435\u0448\u043d\u0435\u0439 \u043e\u043f\u044f\u0442\u044c \u043d\u0430\u0434\u043e \u0445\u0438\u0442\u0440\u0438\u0442\u044c.<\/p>\n<pre><code class=\"javascript\">function send(){ \tfunction __send(id, data){ \t\t... \t} \tif(arguments[0] instanceof Array){ \t\tvar pack = arguments[0]; \t\tvar callback = arguments[1]; \t\tfor(var i=0; i&lt;pack.length; i++){ \t\t\t__send.apply(this, pack[i]); \t\t} \t} } <\/code><\/pre>\n<p>  pack \u044d\u0442\u043e \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<p>  \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0432\u0441\u0451, \u0445\u0438\u0442\u0440\u043e\u0441\u0442\u0438 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438\u0441\u044c, \u043d\u043e \u0436\u0438\u0437\u043d\u044c \u043f\u043e\u0434\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u0435\u0442 \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043f\u0440\u0438\u0447\u0451\u043c \u043e\u0431\u0449\u0438\u0439 \u0434\u043b\u044f \u0432\u0441\u0435\u0439 \u043f\u0430\u0447\u043a\u0438. \u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e\u0434\u0432\u0451\u043b \u043c\u0435\u043d\u044f \u043a \u043e\u0441\u043e\u0437\u043d\u0430\u043d\u0438\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0438 \u043a\u0440\u0430\u0441\u0438\u0432\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u0435\u0434\u043e\u043b\u0433\u0438\u0435 \u0440\u0430\u0437\u0434\u0443\u043c\u044c\u044f \u043f\u0440\u0438\u0432\u0435\u043b\u0438 \u043c\u0435\u043d\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e \u0421\u0438-\u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u043e\u0432. \u0418\u0434\u0435\u044f \u0442\u0430\u043a\u0430\u044f. \u0414\u0435\u043b\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 arguments, \u0430 \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434 checkin \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0442\u043e\u043c\u0443 \u0438\u043b\u0438 \u0438\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0442\u043e\u0442\u0438\u043f\u0443.<br \/>  \u0427\u0442\u043e\u0431\u044b \u0441\u0442\u0430\u043b\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442, \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0438\u0432\u043e\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f. \u041d\u043e\u0432\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043d\u0430\u0437\u043e\u0432\u0451\u043c, \u043d\u0435 \u043c\u0443\u0434\u0440\u0441\u0442\u0432\u0443\u044f, newArg.<\/p>\n<pre><code class=\"javascript\">function send(){ \tfunction __send(){ \t\tvar args = new argSchema(arguments); \t\tif(args.checkin('number id', 'object data', 'opt bool newArg', 'opt function callback')){ \t\t\t\/\/\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b args.id, args.data, args.newArg, args.callback \t\t\t... \t\t} \t\t... \t}  \tvar args = new argSchema(arguments); \tif(args.checkin('array pack', 'opt bool newArg', 'opt function callback')){ \t\tfor(var i=0; i&lt;pack.length; i++){ \t\t\t__send.apply(this, args.pack[i]); \t\t} \t} \telse if(args.checkin('number id', 'object data', 'opt bool newArg', 'opt function callback')){ \t\t__send(args.id, args.data, args.newArg, args.callback); \t} } <\/code><\/pre>\n<p>  \u0418 \u0435\u0441\u043b\u0438 \u0436\u0438\u0437\u043d\u044c \u043f\u043e\u0434\u0431\u0440\u043e\u0441\u0438\u0442 \u043d\u0430\u043c \u0435\u0449\u0451 \u043e\u0434\u0438\u043d \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0438\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0431\u0435\u0437 \u043e\u043f\u0430\u0441\u043a\u0438 \u0441\u043b\u043e\u043c\u0430\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u0430\u043c \u043a\u043e\u0434:<\/p>\n<pre><code class=\"javascript\">var is = function( type, obj ) { \treturn Object.prototype.toString.call( obj ) === &quot;[object &quot;+ type +&quot;]&quot;; } is['string'] = function(obj){ \treturn (typeof obj == 'string' || obj instanceof String); } is.number = function(obj){ \treturn (typeof obj == 'number' || obj instanceof Number); } is.bool = function(obj){ \treturn (typeof obj == 'boolean' || obj instanceof Boolean); } is.object = function(obj){ \treturn (typeof obj == 'object'); } is.array = function(obj){ \treturn (obj instanceof Array); } is.func = function(obj){ \treturn (obj instanceof Function); } is.set = function(obj){ \treturn (obj != undefined && obj != null); } is.unset = function(obj){ \treturn !this.set(obj); }  function argSchema(argArr){     this.checkin = function(){         var arr, qual, type, name;  \t\tfunction check(type, arg){ \t\t\tif(is.unset(arg)) return true; \t\t\tswitch(type){ \t\t\t\tcase 'string': \t\t\t\t\tif(is.string(arg)){ \t\t\t\t\t\tthis[name] = arg; \t\t\t\t\t} \t\t\t\t\telse return false; \t\t\t\t\tbreak; \t\t\t\tcase 'number': \t\t\t\t\tif(is.number(arg)){ \t\t\t\t\t\tthis[name] = arg; \t\t\t\t\t} \t\t\t\t\telse return false; \t\t\t\t\tbreak; \t\t\t\tcase 'bool': \t\t\t\t\tif(is.bool(arg)){ \t\t\t\t\t\tthis[name] = arg; \t\t\t\t\t} \t\t\t\t\telse return false; \t\t\t\t\tbreak; \t\t\t\tcase 'object': \t\t\t\t\tif(is.object(arg)){ \t\t\t\t\t\tthis[name] = arg; \t\t\t\t\t} \t\t\t\t\telse return false;                     break; \t\t\t\tcase 'function': \t\t\t\t\tif(is.func(arg)){ \t\t\t\t\t\tthis[name] = arg; \t\t\t\t\t} \t\t\t\t\telse return false; \t\t\t\t\tbreak; \t\t\t\tcase 'array': \t\t\t\t\tif(is.array(arg)){ \t\t\t\t\t\tthis[name] = arg; \t\t\t\t\t} \t\t\t\t\telse return false; \t\t\t\t\tbreak; \t\t\t} \t\t\treturn true; \t\t} \t\t         for(var i=0, j=0; i&lt;arguments.length; i++){             arr = arguments[i].split(' ');             qual = type = name = null;             if(arr.length == 3){                 qual = arr[0];                 type = arr[1];                 name = arr[2];             }             else if(arr.length == 2){                 type = arr[0];                 name = arr[1];             } \t\t\tdelete this[name]; \t\t\tif(qual == 'opt'){ \t\t\t\tif(check.call(this, type, argArr[j])){ \t\t\t\t\tj++; \t\t\t\t}             }             else{ \t\t\t\tif(!check.call(this, type, argArr[j])) return false;                 j++;             }         }                  return true;     } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u043d\u043e\u0441\u044f\u0442 \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u043e\u044f\u0441\u043d\u044f\u044e\u0449\u0438\u0439 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440 \u0438 \u043d\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438\u0441\u044c \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c. \u0417\u0430\u0442\u043e <a href=\"http:\/\/jsfiddle.net\/saparin77\/Y2mvg\/\">\u0437\u0434\u0435\u0441\u044c<\/a> \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<habracut\/> \t\t\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\/195816\/\"> http:\/\/habrahabr.ru\/post\/195816\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t\u041c\u043d\u043e\u0433\u0438\u0435 \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u043b\u0438\u0441\u044c \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043e\u0434\u0438\u043d, \u0434\u0430 \u0435\u0449\u0451 \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439, \u0442\u043e \u043e\u0441\u043e\u0431\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u043d\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442.<\/p>\n<pre><code class=\"javascript\">function set(name, value){     if(value == undefined){         value = name;     }     ... } <\/code><\/pre>\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-195816","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195816","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=195816"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/195816\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=195816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=195816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=195816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}