Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modernize js #1468

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

modernize js #1468

wants to merge 1 commit into from

Conversation

ShalokShalom
Copy link
Contributor

Current JavaScript standards encourage us to use of let and const instead.

Current JavaScript [standards](https://medium.com/@codingsam/awesome-javascript-no-more-var-working-title-999428999994) encourage us to use of let and const instead.
@ShalokShalom ShalokShalom changed the title moderinze js modernize js Apr 4, 2022
Copy link

@nrdev88 nrdev88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a review of your let and const usage. Current state would break instantly on every browser.

By the way, encouragement of let/const is only true when using >= ES6. I don't know anything about the usage of this file or where it is used within Ventoy, but keep in mind that your (or your client's) js runtime needs to support >= ES6.

var url = '/vtoy/json';
var data = {};
var func = function(data) {};
const url = '/vtoy/json';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's let, not const

var data = {};
var func = function(data) {};
const url = '/vtoy/json';
const data = {};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's let, not const

var func = function(data) {};
const url = '/vtoy/json';
const data = {};
const func = function(data) {};
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's let, not const

msg : "提示内容",
type: 'S',
time: 3000
};
$.extend(ops, options);

var msg_class = 'alert-success';
const msg_class = 'alert-success';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's let, not const

@@ -242,29 +242,29 @@ window.Message = function() {
alert("未知的类型,请使用: w-警告;s-成功;e-失败;i-提示");
return;
}
var $messageContainer = $("#fcss_message");
const $messageContainer = $("#fcss_message");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's let, not const

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants