DM
Size: a a a
DM
DM
ЖС
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
// будем считать, что этот цикл - это типа реакт рендерит
for (let i=0; i<1e6; i++) {
Math.random()
}
res.send('')
})
app.listen(port, () => {
console.log(`Server started http://localhost:${port}`)
})
ЖС
ЖС
DM
const express = require('express')
const app = express()
const port = 3000
const render = async () => {
for (let i=0; i<1e6; i++) {
Math.random()
}
return 'some data'
}
app.get('/', async (req, res) => {
const result = await render()
res.send(result)
})
app.listen(port, () => {
console.log(`Server started http://localhost:${port}`)
})
DM
DM
ЖС
DM
EB
if (str)
закинет тебя в else
если твоя str
- null
str.length
, т.е. null.length
DM
EB
DM
str.match(/[^a-m]/g)
возвращает null
если не сматчилосьEB
str.match(/[^a-m]/g)
возвращает null
если не сматчилосьDM
DM
null
EB
null