if (choise == 1) {
res = Function1(a, b);
}
else if (choise == 2) {
res = Function2(a, b);
}
else if (choise == 3) {
res = Function3(a, b);
}
else if (choise == 4) {
res = Function4(a, b);
}
var request = require('request');
var fs = require('fs');
var options = {
'method': 'GET',
'url': 'ya.ru',
'headers': {
},
formData: {
'aa': {
'value': fs.createReadStream('/C:/Users/Sergei-Pc/Pictures/2019-06-02/002.jpg'),
'options': {
'filename': '/C:/Users/Sergei-Pc/Pictures/2019-06-02/002.jpg',
'contentType': null
}
}
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
let num = prompt('Введите трехзначное число');
var sum = 0;
if(isNaN(num))
alert('Ввыдите только числа');
else{
for ( let i = 0; i < num.length; i++)
sum +=parseInt(num[i]);
alert(sum);
}
class Product_release:Balances,Product
function isString (obj) {
return (Object.prototype.toString.call(obj) === '[object String]');
}
function compare( a, b ) {
if((isString(a.price) && isString(b.price)) || (!isString(a.price) && !isString(b.price))){
if(a.price>b.price)
return 1;
if(a.price<b.price)
return -1;
}
if((isString(a.price) && !isString(b.price)) || (!isString(a.price) && isString(b.price)))
return isString(a.price)?-1:1
return 0;
}
function sorter(map) {
var data = [];
for (var key in map) data.push(map[key]);
data.sort(compare);
var sorted= {};
data.forEach(function (el,index) {
sorted[index]=el;
});
return sorted;
}
url = 'http://httpbin.org/cookies'
cookies = dict(cookies_are='working')
r = requests.get(url, cookies=cookies)`