-
Notifications
You must be signed in to change notification settings - Fork 11
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
Задание первой лекции #6
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
function showElem() { | ||
"use strict"; | ||
var myform, | ||
vseg = myform.elements[0].value, | ||
mass = [], | ||
temp = vseg.split(' '), | ||
j = 0, | ||
i = 0, | ||
num_one, | ||
num_two, | ||
max; | ||
for (j = 0; j <= (temp.length - 1); j++) { //Unexpected '++' | ||
for (i = 0; i <= (temp.length - 1); i++) { //Unexpected '++' | ||
num_one = parseInt(temp[i]); //Missing radix parameter. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing radix parameter - желает получить систему счисления которую будет использовать для парсинга строки. Можно просто писать |
||
num_two = parseInt(temp[i + 1]); //Missing radix parameter. | ||
if (num_one <= num_two) { | ||
max = num_two; | ||
temp[i] = num_one; | ||
temp[i + 1] = max; | ||
} | ||
if (num_one > num_two) { | ||
max = num_one; | ||
temp[i] = num_two; | ||
temp[i + 1] = max; | ||
} | ||
} | ||
} | ||
for (i = 0; i <= (temp.length - 1); i++) { //Unexpected '++' | ||
document.writeln(temp[i]); //'document' was used before it was defined. document.write can be a form of eval | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. JSlint не знает в какой среде используется JS поэтому ругается - можно ему намекнуть - There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Старайся не использовать |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно в начале кода добавить
/*jslint plusplus: true */
, чтобы jslint не ругался