gpt4 book ai didi

javascript - 不变的JS参数不清楚

转载 作者:行者123 更新时间:2023-12-03 04:25:36 27 4
gpt4 key购买 nike

为什么不变函数有这个参数:

function(condition, format, a, b, c, d, e, f) {

而不是:

function invariant(condition : any, format?: string, ...args : Array < any >) {

谁能澄清一下,因为对我来说没有任何意义?

更新:

这是不变库的链接:https://github.com/zertosh/invariant/blob/master/invariant.js

第二个函数是用ES6编写的。

最佳答案

Can anyone clarify, because for me does not make any sense?

这是库作者所做的选择。它们仅支持 6 占位符,因此仅采用 6 个命名参数。

关于javascript - 不变的JS参数不清楚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43750421/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com