gpt4 book ai didi

javascript - 如何一次导出所有常量?

转载 作者:行者123 更新时间:2023-12-02 01:27:15 28 4
gpt4 key购买 nike

我有一个导出常量的文件。

export const PASSWORD_MISMATCH_ERROR = 'Passwords not match!';
export const USER_NOT_FOUND_ERROR = 'User not found';
export const WRONG_PASSWORD_ERROR = 'The password is incorrect';
export const UNAUTHORIZED = 'User unauthorized';

我该怎么做才能不必分别导出每个常量?

最佳答案

ECMAScript 262 specification allows this trivially :

export const
PASSWORD_MISMATCH_ERROR = 'Passwords not match!',
USER_NOT_FOUND_ERROR = 'User not found',
WRONG_PASSWORD_ERROR = 'The password is incorrect',
UNAUTHORIZED = 'User unauthorized';

关于javascript - 如何一次导出所有常量?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74191345/

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