Ребята, подскажите в браузере выдает ошибку, почему и как исправить?
Uncaught ReferenceError: show is not defined
at HTMLInputElement.onchange (index.html?_ijt=1e2q4b7rp7qa280js6hpf45j5c&_ij_re load:17) на эту строку:
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>file</title>
</head>
<body>
<div class="file-read">
<div class="file-input">
<label class="custom-file-upload">
<input type="file" id="file" onchange="show(this)" accept=".txt, .pdf, .epub, .fb2">
Upload a file
</label>
</div>
<a href="">Reset</a>
</div>
<div id="table-div">
<table id="out"></table>
</div>
</body>
</html>
import * as _ from 'lodash';
function show(input) {
const file = input.files[0];
const reader = new FileReader();
reader.readAsText(file, 'UTF-8');
reader.onload = () => {
const res = _.words(reader.result, /[а-яА-ЯёЁa-zA-Z]{4,}/gim);
const result = _.flow([
_.countBy,
_.toPairs,
_.partial(_.orderBy, _, 1, 'desc'),
_.partial(_.take, _, 10),
]);
const txt = result(res).map(([word, num]) => `<tr><td>${word}<td>${num}`).join('');
const out = document.getElementById('out');
out.insertAdjacentHTML('beforeend', txt);
};
}