Skip to content

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