当前位置:网站首页>Chain length value
Chain length value
2022-07-03 08:00:00 【ange2017】
Share a chain long value function , Instead of optional chains .
// Chain length value
get(source, path, defaultValue = undefined) {
const paths = path.replace(/\[(\d+)\]/g, '.$1').split('.')
let result = source
for (const p of paths) {
result = Object(result)[p]
if (result === undefined) {
return defaultValue
}
}
return result
},
边栏推荐
- LwIP learning socket (application)
- vcs import src < ros2. Repos failed
- MaxCompute字符串分割函数-SPLIT_PART
- Install cross compiler arm none liunx gnueabihf
- idea取消引用显示效果
- [MySQL 11] how to solve the case sensitive problem of MySQL 8.0.18
- Technical dry goods | some thoughts on the future of AI architecture
- Professor Zhang Yang of the University of Michigan is employed as a visiting professor of Shanghai Jiaotong University, China (picture)
- Open the influence list of "National Meteorological Short Videos (Kwai, Tiktok) in November" in an interactive way“
- PHP common sorting algorithm
猜你喜欢
Transfinite hacker cognition
璞华PLM为全场景产品生命周期管理赋能,助力产品主线的企业数字化转型
Iterm2 setting
Wechat applet taro learning record
LwIP learning socket (application)
Lua framwrok framework starts
Pat class a 1031 Hello world for u
一篇文章让你读懂-曼彻斯特编码
Install cross compiler arm none liunx gnueabihf
JS common basic case sorting (continuous update)
随机推荐
STM32F103 SPI (pit Diary)
PHP common sorting algorithm
Introduction of novel RNA based cancer therapies
RM delete file
华为交换机基础配置(telnet/ssh登录)
[at] ABC 258g - triple Reach - violence
Client server model
vcs import src < ros2. Repos failed
MAE
[at] abc 258G - Triangle 三元組可達-暴力
Pycharm remote ssh pyenv error: pydev debugger: warning: trying to add breakpoint to file that does
*p++、*++p、++*p、(*p)++
the installer has encountered an unexpected error installing this package
Product creation and commercial realization of chat robot (according to La Ma Bang - Dr. Wang Jingjing - speech)
PIP uses image website to solve the problem of slow network speed
Yolo series --- xml2txt script
YOLO系列 --- xml2txt脚本
Microsoft Security Response Center
tslib库的移植
Huawei switch: configure Telnet, SSH and web access