pass: $form.find("[name='password']").val()
<div data-dudu="hello"></div>
document.querySelector('div').dataset.dudu; // hello
const { src, dest, series } = require('gulp');
const glob = require("glob");
const fs = require('fs');
async function test1() {
let res = null; // <===
glob(__dirname + '/build/**/*.css', {}, (error, files) => {
if (error) throw error;
function readFiles() {
let subarray = [];
for (let name of files) {
subarray = name.split();
let globFile = subarray + '';
let dateFiles = '';
fs.readFile(globFile, "utf8",
function(error, data) {
if (error) throw error;
res = data; // <===
})
}
}
readFiles();
log(readFiles());
})
return res; <===
}
exports.test1= series(test1);
Error
?const parent = () => {
// ...
try {
fs.readFile(fileName, (err, content) => {
if (err) {
throw new Error();
}
})
} catch (e) {
return;
}
// ...
}
const parent = () => {
// ...
let success = true;
fs.readFile(fileName, (err, content) => {
if (err) {
success = false;
return;
}
})
if (!success) return;
// ...
}