{"id":582,"date":"2023-08-14T12:36:34","date_gmt":"2023-08-14T09:36:34","guid":{"rendered":"https:\/\/apimonster.ru\/blog\/?p=582"},"modified":"2024-12-15T15:19:02","modified_gmt":"2024-12-15T12:19:02","slug":"%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs","status":"publish","type":"post","link":"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/","title":{"rendered":"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 &#8220;JavaScript\/NodeJS&#8221;"},"content":{"rendered":"\n<h2 id=\"struktura-vyizyivaemoy-funktsii\" class=\"wp-block-heading\">\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h2>\n\n\n\n<pre class=\"wp-block-preformatted\">function runJavascriptCode(a,b,c,d,e) {\n            'use strict'; \n            let result = null;\n            \n            \/\/------------------------start your code--------------------\n            \n            result = a + b + c + d + e;\n            \n            \/\/--------------------------end your code---------------------\n            \n            return result; \n}\nvar a = '1';\nvar b = '2';\nvar c = '3';\nvar d = '4';\nvar e = '5';\nconsole.log(runJavascriptCode(a,b,c,d,e));        <\/pre>\n\n\n\n<p>\u041f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 \u0443\u0434\u043e\u0431\u043d\u043e\u043c \u0432\u0430\u043c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0435 &#8211; <a href=\"https:\/\/www.jdoodle.com\/execute-nodejs-online\/\">https:\/\/www.jdoodle.com\/execute-nodejs-online\/<\/a> \u0438\u043b\u0438 \u0432\u0430\u0448\u0435\u0439 IDE \u0438 \u0434\u0430\u043b\u0435\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0432 ApiMonster.<\/p>\n\n\n\n<p>\u041d\u0443\u0436\u0435\u043d \u043a\u043e\u0434 \u0434\u043b\u044f \u0441\u0435\u043a\u0446\u0438\u0438 <strong>start your code\/end your code<\/strong>.<\/p>\n\n\n\n<h2 id=\"primeryi-koda\" class=\"wp-block-heading\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430<\/h2>\n\n\n\n<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u0430\u043d\u043d\u044b\u0445  \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0435\u0431\u0445\u0443\u043a\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u0439 url.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">const fetch = require(\"sync-fetch\");       \nconst response = fetch(\"\thttps:\/\/webhook.site\/4c1a1a1c-abeb-41b2-83e1-ae269fb39713\", {\n                            method: \"POST\",\n                            body: JSON.stringify({\n                                a: a,\n                                b: b,\n                                c: c,\n                                d: d,\n                                e: e\n                            })\n                       });\nreturn response.statusText;\n            <\/pre>\n\n\n\n<p>\u0423\u0437\u043d\u0430\u0442\u044c \u0441\u0430\u043c\u044b\u0439 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 sku \u0432 \u0437\u0430\u043a\u0430\u0437\u0435 \u0438\u0437 \u043e\u0437\u043e\u043d\u0430 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0437\u0430\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0445 \u0442\u043e\u0432\u0430\u0440\u043e\u0432.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\/\/check code here - https:\/\/www.jdoodle.com\/execute-nodejs-online\/\n        function runJavascriptCode(a,b,c,d,e) {\n            'use strict'; \n            let result = null;\n            \n            \/\/------------------------start your code--------------------------\n\n            \/\/\u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c json \u0432 \u043c\u0430\u0441\u0441\u0438\u0432            \n            let data = JSON.parse(a);\n            \n            let maxPrice = 0;\n            \n            \/\/\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432\n           for(var i in data){\n               let item = data[i];\n               \n                \/\/\u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0447\u0442\u043e \u0432 \u0442\u0435\u043a\u0443\u0449\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u0435 \u0442\u0430\u043c \u0434\u0430\u043d\u043d\u044b\u0435\n                \/\/console.log(item);\n               \n               let price = item.price * item.quantity;\n               \n               \/\/\u0435\u0441\u043b\u0438 \u0446\u0435\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0446\u0435\u043d\u044b, \u043e\u0431\u0433\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u0430\u043c\u044b\u0439 \u0434\u043e\u0440\u043e\u0433\u043e\u0439 sku\n                if (price&gt;maxPrice){\n                    maxPrice = price;\n                    result = item.offer_id;\n                }\n           }\n\n            \/\/--------------------------end your code--------------------------\n            \n            return result; \n        }\n        var a = '[{    \"price\": \"26890.0000\",    \"offer_id\": \"stwrOD35\",    \"name\": \"\u041e\u0432\u0435\u0440\u043b\u043e\u043a Stoewer OD-35\",    \"sku\": 1084950881,    \"quantity\": 1,    \"mandatory_mark\": [],    \"dimensions\": {      \"height\": \"323.00\",      \"length\": \"447.00\",      \"weight\": \"7550\",      \"width\": \"365.00\"    },    \"currency_code\": \"RUB\"  },  {    \"price\": \"6101.0000\",    \"offer_id\": \"send4bio\",    \"name\": \"\u041f\u0440\u043e\u0442\u043e\u0447\u043d\u044b\u0439 \u0444\u0438\u043b\u044c\u0442\u0440 \u043f\u043e\u0434 \u0440\u0430\u043a\u043e\u0432\u0438\u043d\u0443 Sendo Aqua 4Bio\",    \"sku\": 981820964,    \"quantity\": 1,    \"mandatory_mark\": [],    \"dimensions\": {      \"height\": \"425.00\",      \"length\": \"195.00\",      \"weight\": \"4400\",      \"width\": \"410.00\"    },    \"currency_code\": \"RUB\"  }]';\n        var b = '';\n        var c = '';\n        var d = '';\n        var e = '';\n        console.log(runJavascriptCode(a,b,c,d,e));        <\/pre>\n\n\n\n<p>\u041f\u043e\u0434\u043c\u0435\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">function runJavascriptCode(a,b,c,d,e) {\n            'use strict'; \n            let result = null;\n            \n            \/\/------------------------start your code--------------------------\n            \n                        \/\/\u043c\u0430\u043f\u043f\u0438\u043d\u0433: \u0430\u0440\u0442\u0438\u043a\u0443\u043b wb &gt; \u0430\u0440\u0442\u0438\u043a\u0443\u043b rcrm\n            let map = {\n                'snd123':'rcrmArticle',\n                'wbArticle1':'rcrmArticle1',\n            }\n            \n            \/\/\u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u043c json \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\n            let order = JSON.parse(a);\n            \n            \/\/\u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0430\u043f\u043f\u0438\u043d\u0433\n            for (let wbArticle in map) {\n                \/\/\u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0448\u0435\u043b \u0430\u0440\u0442\u0438\u043a\u0443\u043b \u0438\u0437 \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0430, \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f rcrm\n                if (order.hasOwnProperty('article') &amp;&amp; order['article'] === wbArticle){\n                    order['article'] = map[wbArticle];\n                    break;\n                }\n            }\n            \n            \/\/\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u0430\u043a\u0430\u0437\u0430\n            result = JSON.stringify(order);\n            \n            \/\/--------------------------end your code--------------------------\n            \n            return result; \n        }\n        var a = '{\"address\":null,\"deliveryType\":\"fbs\",\"user\":null,\"orderUid\":\"5483976_11741988085208591\",\"article\":\"snd4bio\",\"rid\":\"11741988085208591.0.0\",\"createdAt\":\"2023-11-20T06:33:05Z\",\"offices\":[\"\u041c\u043e\u0441\u043a\u0432\u0430_\u0417\u0430\u043f\u0430\u0434-\u042e\u0433\"],\"skus\":[\"4673744335316\"],\"id\":1213910358,\"warehouseId\":143195,\"nmId\":123,\"chrtId\":264161474,\"price\":511300,\"convertedPrice\":511300,\"currencyCode\":643,\"convertedCurrencyCode\":643,\"cargoType\":1,\"name\":\"test\"}';\n        var b = '';\n        var c = '';\n        var d = '';\n        var e = '';\n        console.log(runJavascriptCode(a,b,c,d,e));  <\/pre>\n\n\n\n<p>\u0412\u044b\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0438 \u0438\u0437 \u042f\u043d\u0434\u0435\u043a\u0441 \u041c\u0435\u0442\u0440\u0438\u043a\u0438 \u043f\u043e utm-\u043c\u0435\u0442\u043a\u0430\u043c, \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 csv \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0432 google sheets.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">  \/\/\u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438\n    const fetch = require(\"sync-fetch\");\n \n\/\/\u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438\n    function createUrl(baseUrl, params) {\n        let items = [];\n        for (let key in params) {\n            items.push(key + \"=\" + params[key]);\n        }\n        return baseUrl + \"?\" + items.join('&amp;');\n    }\n \n    function createCsv(csvRows) {\n        return csvRows.join(\"\\r\\n\");\n    }\n \n\/\/\u0442\u043e\u043a\u0435\u043d\u044b\n \n    let token = \"AQAAAAAm6eb9AAc4_123456\";\n \n \n\/\/\u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0432 api\n \n    let dateFrom = \"2024-03-01\";\n    let dateTo = \"2024-03-31\";\n \n    let params = {\n        \"id\": 82227529,\n        \"metrics\": \"ym:s:visits,ym:s:users\",\n        \"dimensions\": \"ym:s:UTMSource,ym:s:UTMMedium,ym:s:UTMCampaign,ym:s:UTMContent,ym:s:UTMTerm\",\n        \"date1\": dateFrom,\n        \"date2\": dateTo\n    };\n \n    let baseUrl = \"https:\/\/api-metrika.yandex.net\/stat\/v1\/data\";\n \n    let url = createUrl(baseUrl, params);\n \n\/\/\u0434\u0435\u043b\u0430\u0435\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u0432 api\n \n    let headers = {\n        'Content-Type': 'application\/json;charset=utf-8',\n        'Authorization': \"OAuth \" + token\n    };\n \n    let response = fetch(url, {method: \"get\", \"headers\": headers});\n \n\/\/\u0435\u0441\u043b\u0438 \u0432\u0435\u0440\u043d\u0443\u043b\u0441\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u044b\u0439 \u043e\u0442\u0432\u0435\u0442\n    if (response.status === 200) {\n \n        let data = response.json(); \/\/\u043e\u0442\u0432\u0435\u0442 api\n        let csvRows = []; \/\/\u043c\u0430\u0441\u0441\u0438\u0432 \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e csv\n \n        \/\/\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u0432\u0435\u0440\u043d\u0443\u043b\u043e api\n        \/\/ console.log(data);\n \n        \/\/\u0440\u0438\u0441\u0443\u0435\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0430\n \n        csvRows.push(\"\u041e\u0442\u0447\u0435\u0442 \u043f\u043e UTM-\u043c\u0435\u0442\u043a\u0430\u043c, \u043f\u0435\u0440\u0438\u043e\u0434: \" + dateFrom + \" - \" + dateTo);\n        csvRows.push(\"\");\n        csvRows.push(data.query.dimensions.join(\";\") + ';' + data.query.metrics.join(\";\"))\n \n        \/\/\u0440\u0438\u0441\u0443\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0438 \u0434\u0430\u0448\u0431\u043e\u0440\u0434\u0430\n \n        data.data.forEach(function (item, i, arr) {\n            let rowData = [];\n            rowData.push(item.dimensions[0].name);\n            rowData.push(item.dimensions[1].name);\n            rowData.push(item.dimensions[2].name);\n            rowData.push(item.dimensions[3].name);\n            rowData.push(item.dimensions[4].name);\n            rowData.push(item.metrics[0]);\n            rowData.push(item.metrics[1]);\n            csvRows.push(rowData.join(\";\"));\n        });\n \n        \/\/\u0434\u0435\u043b\u0430\u0435\u043c csv\n        let result = createCsv(csvRows);\n        \/\/ \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 csv\n        \/\/ console.log(result);\n \n        \/\/\u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0438\u0445 \u0448\u0430\u0433\u043e\u0432 \u0441\u0432\u044f\u0437\u043a\u0438\n        return result;\n    } else {\n        \/\/\u043e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430\n    }<\/pre>\n\n\n\n<p>\u041f\u0430\u0440\u0441\u0438\u043d\u0433 JSON \u0441 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u043c\u0438 \u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 &#8220;item&#8221;:&#8221;\u0421\u043e\u0443\u0441 \\&#8221;\u0412\u0430\u0441\u0430\u0431\u0438\\&#8221;&#8221;:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function jsonParse(raw){\n    raw = raw.replace(\/\\s\\\"\/g,' ');\n    raw = raw.replace(\/\\\"\\s\/g,' ');\n    raw = raw.replace('\"\"','\"');\n    return  JSON.parse(raw);\n}<\/code><\/pre>\n\n\n\n<p>\u041a\u043e\u0440\u0440\u0435\u043a\u0446\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>function fixName(value){\n    let chars = &#91;\"\u0441.\",\"\u0433.\"];\n    let result = value;\n    if (value.indexOf('\u0441.')==-1){\n        chars.forEach((char) =&gt; {\n            result = result.replace(char,'');\n        })\n        result = result.trim();\n        result = '\u0433. ' + result;\n    }\n    \n    return result;    \n}\n\nlet cases = &#91;'\u0410\u043a\u0442\u0430\u0443','\u0441.\u0410\u043a\u0442\u0430\u0443','\u0433.\u0410\u043a\u0442\u0430\u0443','\u0433. \u0410\u043a\u0442\u0430\u0443', '\u0441. \u0410\u043a\u0442\u0430\u0443', '\u0441. \u041b\u043e\u0441 \u0421\u0430\u043d\u0442\u043e\u0441', '\u0433. \u041b\u043e\u0441 \u0421\u0430\u043d\u0442\u043e\u0441','\u041b\u043e\u0441 \u0421\u0430\u043d\u0442\u043e\u0441'];\n\ncases.forEach((value) =&gt; {\n  console.log(value + \" &gt; \" + fixName(value));\n})<\/code><\/pre>\n\n\n\n<p>\u0428\u0430\u0431\u043b\u043e\u043d \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\/\/\u0442\u0440\u0435\u0431\u0443\u0435\u043c\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f\nfunction parseIds(str){\n    const regex = \/\\d{4}\/gm;\n    let m;\n    let matches = &#91;];\n    while ((m = regex.exec(str)) !== null) {\n        if (m.index === regex.lastIndex) {\n            regex.lastIndex++;\n        }\n        m.forEach((match, groupIndex) => {\n            matches.push(match);\n        });\n    }\n    return matches.join(',');\n}\n\n\n\/\/\u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u043a\u0435\u0439\u0441\u044b - \u0447\u0442\u043e \u043d\u0430 \u0432\u0445\u043e\u0434\u0435 \u0438 \u0447\u0442\u043e \u043e\u0436\u0438\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435\nlet cases = &#91;\n    {\n        'value':'\u0421\u0447\u0435\u0442\u0430 \u043d\u0430 \u043e\u043f\u043b\u0430\u0442\u0443 \u21161233,3243,3443,3434 \u0437\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b',\n        'result':'1233,3243,3443,3434'\n    },\n        {\n        'value':'\u0421\u0447\u0435\u0442\u0430 \u043d\u0430 \u043e\u043f\u043b\u0430\u0442\u0443 \u21161233 \u0437\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0431\u043e\u0442\u044b',\n        'result':'1233'\n    }\n];\n\n\/\/\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \n\ncases.forEach((c) => {\n    let result = parseIds(c&#91;'value']);\n    \n    \/\/\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439\n    if (result === c&#91;'result']){\n        console.log(c&#91;'value'] + ' - OK')\n    }\n    \/\/\u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u043d\u0435 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u044b\u0439\n    else{\n        console.log(c&#91;'value'] + ' - ERROR, result = ' + result + ', \u043e\u0436\u0438\u0434\u0430\u043b\u043e\u0441\u044c = ' + c&#91;'result'])\n    }\n});<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 function runJavascriptCode(a,b,c,d,e) { &#8216;use strict&#8217;; let result = null; \/\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;start your code&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; result = a + b + c + d + e; \/\/&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;end your code&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212; return&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"powerkit_post_featured":[],"class_list":{"0":"post-582","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-dokumentacija"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.8 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 &quot;JavaScript\/NodeJS&quot; - ApiMonster<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/apimonster.ru\/blog\/\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442-javascript-nodejs\/\" \/>\n<meta property=\"og:locale\" content=\"ru_RU\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 &quot;JavaScript\/NodeJS&quot; - ApiMonster\" \/>\n<meta property=\"og:description\" content=\"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 function runJavascriptCode(a,b,c,d,e) { &#039;use strict&#039;; let result = null; \/\/------------------------start your code-------------------- result = a + b + c + d + e; \/\/--------------------------end your code--------------------- return&hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/apimonster.ru\/blog\/\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442-javascript-nodejs\/\" \/>\n<meta property=\"og:site_name\" content=\"ApiMonster\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-14T09:36:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-12-15T12:19:02+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u043c\u0438\u043d\u0443\u0442\u044b\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/\",\"url\":\"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/\",\"name\":\"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \\\"JavaScript\/NodeJS\\\" - ApiMonster\",\"isPartOf\":{\"@id\":\"https:\/\/apimonster.ru\/blog\/#website\"},\"datePublished\":\"2023-08-14T09:36:34+00:00\",\"dateModified\":\"2024-12-15T12:19:02+00:00\",\"author\":{\"@id\":\"https:\/\/apimonster.ru\/blog\/#\/schema\/person\/587296d074060526a3d850fb9fee163e\"},\"breadcrumb\":{\"@id\":\"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/#breadcrumb\"},\"inLanguage\":\"ru-RU\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430\",\"item\":\"https:\/\/apimonster.ru\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 &#8220;JavaScript\/NodeJS&#8221;\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/apimonster.ru\/blog\/#website\",\"url\":\"https:\/\/apimonster.ru\/blog\/\",\"name\":\"ApiMonster\",\"description\":\"\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0438 \u0441\u0442\u0430\u0442\u044c\u0438\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/apimonster.ru\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ru-RU\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/apimonster.ru\/blog\/#\/schema\/person\/587296d074060526a3d850fb9fee163e\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ru-RU\",\"@id\":\"https:\/\/apimonster.ru\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/278fa5f7bd5cd7539b82238a4f076d2ba6d136401faa390564e6868569f098bf?s=96&d=retro&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/278fa5f7bd5cd7539b82238a4f076d2ba6d136401faa390564e6868569f098bf?s=96&d=retro&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/apimonster.ru\/blog\"],\"url\":\"https:\/\/apimonster.ru\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \"JavaScript\/NodeJS\" - ApiMonster","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/apimonster.ru\/blog\/\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442-javascript-nodejs\/","og_locale":"ru_RU","og_type":"article","og_title":"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \"JavaScript\/NodeJS\" - ApiMonster","og_description":"\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 function runJavascriptCode(a,b,c,d,e) { 'use strict'; let result = null; \/\/------------------------start your code-------------------- result = a + b + c + d + e; \/\/--------------------------end your code--------------------- return&hellip;","og_url":"https:\/\/apimonster.ru\/blog\/\u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442-javascript-nodejs\/","og_site_name":"ApiMonster","article_published_time":"2023-08-14T09:36:34+00:00","article_modified_time":"2024-12-15T12:19:02+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u041d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u043e\u043c":"admin","\u041f\u0440\u0438\u043c\u0435\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0434\u043b\u044f \u0447\u0442\u0435\u043d\u0438\u044f":"4 \u043c\u0438\u043d\u0443\u0442\u044b"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/","url":"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/","name":"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \"JavaScript\/NodeJS\" - ApiMonster","isPartOf":{"@id":"https:\/\/apimonster.ru\/blog\/#website"},"datePublished":"2023-08-14T09:36:34+00:00","dateModified":"2024-12-15T12:19:02+00:00","author":{"@id":"https:\/\/apimonster.ru\/blog\/#\/schema\/person\/587296d074060526a3d850fb9fee163e"},"breadcrumb":{"@id":"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/#breadcrumb"},"inLanguage":"ru-RU","potentialAction":[{"@type":"ReadAction","target":["https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/apimonster.ru\/blog\/%d0%b8%d0%bd%d1%81%d1%82%d1%80%d1%83%d0%bc%d0%b5%d0%bd%d1%82-javascript-nodejs\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430","item":"https:\/\/apimonster.ru\/blog\/"},{"@type":"ListItem","position":2,"name":"\u0418\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 &#8220;JavaScript\/NodeJS&#8221;"}]},{"@type":"WebSite","@id":"https:\/\/apimonster.ru\/blog\/#website","url":"https:\/\/apimonster.ru\/blog\/","name":"ApiMonster","description":"\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0438 \u0441\u0442\u0430\u0442\u044c\u0438","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/apimonster.ru\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ru-RU"},{"@type":"Person","@id":"https:\/\/apimonster.ru\/blog\/#\/schema\/person\/587296d074060526a3d850fb9fee163e","name":"admin","image":{"@type":"ImageObject","inLanguage":"ru-RU","@id":"https:\/\/apimonster.ru\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/278fa5f7bd5cd7539b82238a4f076d2ba6d136401faa390564e6868569f098bf?s=96&d=retro&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/278fa5f7bd5cd7539b82238a4f076d2ba6d136401faa390564e6868569f098bf?s=96&d=retro&r=g","caption":"admin"},"sameAs":["https:\/\/apimonster.ru\/blog"],"url":"https:\/\/apimonster.ru\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/posts\/582","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/comments?post=582"}],"version-history":[{"count":12,"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/posts\/582\/revisions"}],"predecessor-version":[{"id":674,"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/posts\/582\/revisions\/674"}],"wp:attachment":[{"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/media?parent=582"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/categories?post=582"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/tags?post=582"},{"taxonomy":"powerkit_post_featured","embeddable":true,"href":"https:\/\/apimonster.ru\/blog\/wp-json\/wp\/v2\/powerkit_post_featured?post=582"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}