let myVar = false;
const getMyVar = () => myVar;
const setMyVar = (value) => { myVar = value };
module.exports = { getMyVar, setMyVar };
const { getMyVar, setMyVar } = require('./myVarModule');
console.log(getMyVar());
setMyVar(true);
console.log(getMyVar());
paramsSerializer.indexes
Configuration for formatting array indexes in the params.
Three available options:
(1)indexes: null
(leads to no brackets),
(2) (default)indexes: false
(leads to empty brackets),
(3)indexes: true
(leads to brackets with indexes).
axios.get('https://api.kinopoisk.dev/v1.4/movie', {
params: {
page: page,
limit: limit,
notNullFields: ['poster.url', 'movieLength']
},
paramsSerializer: {
indexes: null
}
});
for (let i = 0; i < clickCount - 1; i++) {
elementstypeWorkFirst[i].innerHTML = '';
}
{ name:"object" }
и привязал его канатом с биркой obj к земле (obj = ...
).arrq = [obj]
).obj = null
).arrq[0] = null
), то он улетит и в конце концов где-то упадёт и пропадёт (сработает сборщик мусора). Stage: 4
Two compatible implementations which pass the acceptance tests
app.options('/user', cors());
app.post('/user', cors(), ....);
?.
без пробелов.===
или ++
.application/x-www-form-urlencoded
const response = await fetch(
'https://example.com:8443/server',
{
method: 'PUT',
body: new URLSearchParams(new FormData(payForm)),
}
);
req.on('data', ...)
не нужен.app.use(bodyParser.urlencoded({ extended: false }));
app.put('/server',(req, res) => {
const mail = req.body.email;
res.writeHead(200, {'Content-Type': 'text/plain; charset=utf-8'})
res.end(mail);
})
multipart/form-data
, то на сервере нужен multer, т.к. встроенный в Express body-parser не умеет обрабатывать такие запросы. IsLessThan
.