Skip to content

Add files via upload #20

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

Open
wants to merge 1 commit into
base: js-12-2
Choose a base branch
from
Open

Conversation

codebasecodebase
Copy link
Owner

No description provided.

if(!file) {
const pole = document.getElementById('read');
const pole1 = document.getElementById('error');
pole.setAttribute("style", "background-color: coral");

Choose a reason for hiding this comment

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

Делайте стилизацию при помощи классов

div.innerText = `Length: ${result.length}; Words: ${result.split(' ').length}`;
const div1 = document.getElementById('results2');
div1.innerText = '';
var allowed = /\w/i;

Choose a reason for hiding this comment

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

Должны быть подсчитаны все символы, без исключений

const result = reader.result;
const div = document.getElementById('results');
div.innerText = `Length: ${result.length}; Words: ${result.split(' ').length}`;
const div1 = document.getElementById('results2');

Choose a reason for hiding this comment

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

Давайте переменным осмысленные названия

let trs = document.querySelectorAll('#results2 div');
let table = document.getElementById('results2');
let sorted = [...trs].sort(function(a, b) {
if (a.children[3].innerHTML >= b.children[3].innerHTML) {

Choose a reason for hiding this comment

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

Не делайте так сортировку. Это очень трудоемкий для браузера способ. Данные из интерфейса никогда не должны использоваться для сортировки!

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.

2 participants