const { exec } = require('child_process');
exec('python test.py', (error, stdout, stderr) => {
if (error) {
console.error(`exec error: ${error}`);
return;
}
console.log(`stdout: ${stdout}`);
console.error(`stderr: ${stderr}`);
});
count = 0
while count < 1e6:
count = count + 1
print(count)
const req = {array: '[{num: 1}, {num: 2}, {num: 3}]'};
const array = eval(req.array);
console.log(array);
<?php
$file = fopen("./file.txt", "r");
while(!feof($file))
{
$str = fgets($file);
$matches = [];
preg_match("/\d+\s?\d+/", $str, $matches);
print_r($matches);
}
fclose($file);
охрана труда 167 589\r\n
<!doctype html>
<html>
<head>
</head>
<body>
</body>
<script>
document.addEventListener("click", (event) => {
if (event.target.className === 'img') {
alert('click on img');
}
});
const showJoke = (id, category, joke, updated) => {
return `
<div class="joke">
<div class="joke__id">
id: <a href="https://api.chucknorris.io/jokes/${id}">ID: ${id}</a><img src="../link.png" alt="">
</div>
// на эту картинку нужно повесить событие
<img class="img" src="https://img.icons8.com/ios/50/000000/like.png">
//
<div class="joke__text">
${joke}
</div>
<div class="joke__info">
<div class="info__updated">
Last update: ${updated} hours ago
</div>
<div class="info__category">
${category}
</div>
</div>
</div>
`;
};
const html = showJoke('id', 'category', 'joke', 'updated');
document.body.insertAdjacentHTML('afterbegin', html);
</script>
</html>
console.log(Number.MAX_SAFE_INTEGER)
//9007199254740991
const array = [9, 2, 2, 3, 3, 7, 2, 0, 3, 6, 8, 5, 4, 7, 7, 5 , 6,7,7];
const number = BigInt(array.join(''));
console.log(number.toString());