leconio 最近的时间轴更新
leconio

leconio

V2EX 第 347735 号会员,加入于 2018-09-06 22:40:02 +08:00
今日活跃度排名 7373
求推荐个串流设备,最好安卓的
硬件  •  leconio  •  170 天前  •  最后回复来自 Puteulanus
6
看看 GPT-4 中文理解能力
分享发现  •  leconio  •  2023-03-31 10:45:55 AM  •  最后回复来自 dashsoap97
10
求助帖,做过跨端(iOS 和 Android)开发的看过来
问与答  •  leconio  •  2019-08-19 10:10:27 AM  •  最后回复来自 yurnery
31
给大家个无足轻重的小 Chrome 插件,复制代码可能用到
程序员  •  leconio  •  2018-11-12 15:47:09 PM  •  最后回复来自 glaucus
1
iMac 如何让发射出来的 wifi 走本地代理
问与答  •  leconio  •  2018-11-08 09:24:40 AM  •  最后回复来自 leconio
2
为什么我不用浏览器
 •  leconio  •  2018-10-24 11:04:26 AM  •  最后回复来自 diggerdu
12
leconio 最近回复了
太阳活动异常,地球磁场消失,对太阳辐射和宇宙射线防护变弱,然后现存的消失。。。我们生存环境好脆弱。
安卓好像没有能激发亮度的 HDR
写写画画,看看奈飞,iPad 好很多
对于开发者,安卓生态圈要好很多
geosite 抄下最新的地址
支付宝我记得欠费也可以冲
6 天前
回复了 lurui45 创建的主题 生活 关于日常药店买药的一些想法
药店刷社保,感觉像零元购,(其实那也是工资一部分呀)
6 天前
回复了 xiaopanzi 创建的主题 NAS 群晖远程唤醒方案
或者买个开机棒,那个就是发魔法包的
6 天前
回复了 xiaopanzi 创建的主题 NAS 群晖远程唤醒方案
使用场景是啥,群晖一直开着不就行了吗。我的 220 开一次机要好久好久。
7 天前
回复了 Lucoie 创建的主题 拼车 求 iCloud 拼车,有无 music 都可
我在这家买的,用了一年了,挺稳的。发个链接。https://nf.video/suJDp
7 天前
回复了 Bateman 创建的主题 问与答 哪有便宜的黄油和芝士卖?
lsp 们可以出去了,OP 正经问的。
9 天前
回复了 waiaan 创建的主题 JavaScript 这段 if...else 有优雅的写法吗?
const sortStrategies = {
descending: (prop) => (a, b) => b[prop] - a[prop],
ascending: (prop) => (a, b) => a[prop] - b[prop]
};

const sortCommands = {
thisYearIncome: {
descending: () => sortStrategies.descending('thisYearIncome'),
ascending: () => sortStrategies.ascending('thisYearIncome')
},
lastYearIncome: {
descending: () => sortStrategies.descending('lastYearIncome'),
ascending: () => sortStrategies.ascending('lastYearIncome')
},
rate: {
descending: () => sortStrategies.descending('rate'),
ascending: () => sortStrategies.ascending('rate')
}
};

function createSortCommand(order, prop) {
return sortCommands[prop][order]();
}

const data = [
{ thisYearIncome: 5000, lastYearIncome: 4000, rate: 0.25 },
{ thisYearIncome: 8000, lastYearIncome: 6000, rate: 0.33 },
{ thisYearIncome: 3000, lastYearIncome: 2000, rate: 0.5 },
{ thisYearIncome: 6000, lastYearIncome: 5000, rate: 0.2 }
];

function onSortChange(order, prop) {
const sortCommand = createSortCommand(order, prop);
fetchData(sortCommand);
}

function fetchData(sortCommand) {
const sortedData = data.sort(sortCommand);

console.log('Sorted Data:');
sortedData.forEach((item) => {
console.log(`This Year Income: ${item.thisYearIncome}, Last Year Income: ${item.lastYearIncome}, Rate: ${item.rate}`);
});
}

console.log('Sorting by This Year Income (Descending):');
onSortChange('descending', 'thisYearIncome');

console.log('\nSorting by Last Year Income (Ascending):');
onSortChange('ascending', 'lastYearIncome');

console.log('\nSorting by Rate (Descending):');
onSortChange('descending', 'rate');
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1344 人在线   最高记录 6543   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 21ms · UTC 17:42 · PVG 01:42 · LAX 10:42 · JFK 13:42
Developed with CodeLauncher
♥ Do have faith in what you're doing.