list[0]
. Math.max.apply(null, list)
function max(list) {
return list.reduce((a, b) => a > b ? a : b);
}
function max(list) {
let max = list[0];
list.forEach(function(e) {
if (e > max) max = e;
});
return max;
}
string n = "GET /index.html?id1=1&id2=2&id3=3&id4=4 HTTP/1.1";
string q = n.Split(new Char[] { ' ', '?' })[2];
foreach(string p in q.Split(new Char[] { '&' }))
{
System.Console.Write(p.Split(new Char[] { '=' })[1]);
}
router.route('/:user')
.get(function (request, response) {
var userName = req.params.user;
userService.findUserByName(userName)
.then(onUserSuccess, function (err) {
errorHandle(err, reponse);
})
.then(onProviderSuccess, function (err) {
errorHandle(err, reponse);
});
});
function errorHandle(err, reponse) {
return reponse.status(200).json({
error: false
});
}