也许我没有正确使用谷歌搜索。没有参数的 then 函数不会阻塞吗?例如,你有一个承诺:
someFunc = () => {
return new Promise((res,rej)=>{
somethingAsync(input).then((val) => res(val))
})
}
Run Code Online (Sandbox Code Playgroud)
在我们功能的以下实现中。两者都会等待 someFunc 返回值吗?
someFunc().then(dosomethingafter())
someFunc().then((val) => dosomethingafter())
Run Code Online (Sandbox Code Playgroud) 我正在使用的第 3 方工具构建了一个锚标签,就像这样..
"<a href="http://DevNode/Lists/Publications.aspx#/publication/123">http://DevNode/Lists/Publications.aspx#/publication/123</a>"
Run Code Online (Sandbox Code Playgroud)
我需要隔离 href 以便我可以修剪它。目前我的模式
reg = /^(<a\shref=")? http:\/\/DevNode\/Lists\/Publications.aspx#\/publication\/(\d+)/i {lastIndex: 0}
Run Code Online (Sandbox Code Playgroud)
如果 href 有这样的前导空格,将无法匹配
"<a href=" http://DevNode/Lists/Publications.aspx#/publication/123"> http://DevNode/Lists/Publications.aspx#/publication/123</a>"
Run Code Online (Sandbox Code Playgroud)
请帮忙