import { VK, Method } from 'vkstatic'
const params = {
token: String (),
groupId: Number ()
}
const vk = new VK ({
...params
})
const bot = async () => {
await new Method ()
.event (response => {
console.log (response.event.event_type)
})
}
bot ()
let name = prompt("Enter your name:",);
let age = +prompt("Enter your age:",);
var x;
function checkAge(age){
if(age >= 1 && age <= 17) {
x = "Ребенок";
} else if(age >= 18 && age <=100) {
x = "Не ребенок";
}
}
function about(name, age) {
checkAge(age);
alert(`${name} имеет возраст ${age} и он ${x}`);
}
about(name, age)
import fetch from 'fetch'
const response = async () => await fetch ('https://ipapi.co/json/')
.then (response => response.json ())
const IPuser = response.ip
const dov = "IP" // АЙПИ опреленного человека
if (dov != IPuser) {
//..native code
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body onload="num()">
<span id="num"></span>
<div id ="divs"></div>
<script type="text/javascript">
code javascript
</script>
</body>
</html>
const div = document.querySelector("#divs");
let testingTime = 5;
setInterval(() => { testingTime -= 1; div.innerHTML = testingTime + 'сек' }, 1000);
setTimeout(() => window.open("https://youtu.be/dQw4w9WgXcQ", "_self"), 5000)
function getNumberMask (number) {
var string = number.match(/^(\(?\+?\d{1,2}\)? ?\(?\d{1,3}\)? ?\d+\-? ?\d+\-? ?\d+)$/);
string = string[0];
var result = "";
for (var i =0;i<4;i++) {
result += string[i];
}
for (var i = 4; i<string.length;i++){
result += string[i].replace(string[i], "*");
}
return result;
}
console.log(getNumberMask("79502306392"))
const { default: axios } = require('axios');
const amout = require('./type'); // можете сделать .js, но он и так найдет.
async function crystal() {
const response = await axios.get('https://api.crystalpay.ru/v1/?', {
params: {
s: '',
n: '',
o: 'invoice-create',
amount: amout,
lifetime: '1440',
callback: 'localhost',
extra: ''
}
})
// console.log(response);
return response.data.id
}
module.exports.crystal = crystal
module.exports = 10