菜鸟教程小白 发表于 2022-12-11 20:33:07

javascript - 2018 年 Safari 9 中的箭头功能有问题吗?


                                            <p><p>我读到了 <a href="https://stackoverflow.com/questions/35075671/how-to-run-es6-code-with-arrow-functions-in-safari" rel="noreferrer noopener nofollow">How to run ES6 code with arrow functions in Safari?</a>但这个问题是从 2016 年 1 月开始的。我还在 github 上创建了一个关于这个问题的问题,但它也是从 2016 年开始的。</p>

<p>我使用箭头函数,我的主脚本看起来像 <code>(()=>{ ... })()</code>。因此,它在除 Safari 9 之外的所有浏览器中都能正常工作。最后一个给我一个错误 <code>SyntaxError: Unexpected token ')'</code>。</p>

<p>通过附加链接,我发现“Safari 尚不支持此功能”。在 MDN 站点中,我没有发现 Safari 不支持这些东西的任何地方。我也在这里<a href="http://kangax.github.io/compat-table/es6/" rel="noreferrer noopener nofollow">http://kangax.github.io/compat-table/es6/</a> .我不太了解那里的 table ,但我看到了 Safari,它是绿色的。 </p>

<p>所以,我不明白,Safari 是否支持箭头功能?还是我的错误有其他原因?</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>如果您在那里没有找到答案,请尝试 <a href="https://caniuse.com/#search=arrow%20functions" rel="noreferrer noopener nofollow">https://caniuse.com/#search=arrow%20functions</a> .我确定这就是您所需要的!</p></p>
                                   
                                                <p style="font-size: 20px;">关于javascript - 2018 年 Safari 9 中的箭头功能有问题吗?,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/52172484/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/52172484/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: javascript - 2018 年 Safari 9 中的箭头功能有问题吗?