[英]Pass arguments of a Tagged Template Literals function to another one?
假設有兩個功能。 第二個使用第一個:
func1 = function() { console.log(arguments) } func2 = function() { func1(arguments) } func1`foo` func2`bar`
正如我們在結果中看到的那樣,這是一個論點的論點。 壞的。
我只想將func2
的 arguments 傳遞給func1
。 在func2
中,我嘗試了以下調用,但沒有任何效果:
func1`arguments`
func1`${arguments}`
func1({...arguments})
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.