message.channel.edit(membed)
message.channel.send("сообщение").then(m => {
// ...где m является классом Message
m.edit("новый_контент_сообщения")
})
function calculateFoodOrder(numAnimals, avgFood) {
var numAnimals = 10;
var avgFood = 3;
if (numAnimals < 0) {
return -1;
} else if (numAnimals = String) {
return -1;
} else if (avgFood < 0) {
return -1;
} else if (avgFood = String) {
return -1;
} else {
return numAnimals * avgFood;
}
}
console.log(calculateFoodOrder());
if (typeof numAnimals === "string") { return . . . }
console.log( calculateFoodOrder(значение1, значение2) )
console.log( calculateFoodOrder(550, 241) ) // пример
var arr = [];
arr.push(200)
console.log(arr) // [200]
let message = (age < 3) ? 'Здравствуй, малыш!' : (age < 18) ? 'Привет!' : (age < 100) ? 'Здравствуйте!' : 'Какой необычный возраст!';
let I = 'b'+'a'
a
и b
у вас обратиться не получится, так как бинарный оператор '+' конкатенирует две строки, и переменной присваивается уже сам результат конкатенации.let arr = ["a", "b"];
let output = "";
const changeElements = (first, second) => {
if (first === undefined) {
arr[1] = second;
output = arr[0] + arr[1]
} else if (second === undefined) {
arr[0] = first;
output = arr[0] + arr[1]
} else {
arr[0] = first;
arr[1] = second;
output = arr[0] + arr[1]
}
}
changeElements("c")
console.log(output) // "cb"
changeElements("o", "f")
console.log(output) // "of"
const getCurrentTime = () => {
let date = new Date(),
hours = "",
minutes = "";
if (String(date.getHours()).length < 2) {
hours += String(0) + String(date.getHours())
} else {
hours = `${date.getHours()}`
}
if (String(date.getMinutes()).length < 2) {
minutes += String(0) + String(date.getMinutes())
} else {
minutes = `${date.getMinutes()}`
}
return `${hours}:${minutes}`
}
if (getCurrentTime() === '00:00') {
// действие
}
var obj = {
"MapName": "Adeyyo",
"JDVersion": 2019,
"OriginalJDVersion": 2019,
"Artist": "Ece Seçkin",
"Title": "Adeyyo",
"Credits": "Written by Aysen Şimşekyay, Kemal Şimşekyay and arranged by Ozan Doğulu. Published by DMC & PRM. Courtesy of DGL. All rights of the producer and other rightholders to the recorded work reserved. Unless otherwise authorized, the duplication, rental, loan, exchange or use of this video game for public performance, broadcasting and online distribution to the public are prohibited.",
"NumCoach": 1,
"BannerVideo": 0,
"CoachBeat": 1210,
"OnlineMap": 0,
"Tags": [
"main"
],
"PictogramBar": 1,
"PictoDuration": 3000,
"BeatDuration": 3000,
"LyricDuration": 1750,
"PictoResolutionX": 256,
"PictoResolutionY": 256,
"PictoResolutionUHD": 0,
"VideoType": "mp4",
"AudioType": "ogg",
"LyricColors": [111, 255, 182],
"LyricSpeed": 100,
"goldmoves": [166105, 226105],
"Difficulty": 1,
"DefaultColors": {
"lyrics": "0xFF6FFFB6",
"theme": "0xFFFFFFFF",
"songColor_1A": "0xFF010342",
"songColor_1B": "0xFF411554",
"songColor_2A": "0xFF97FAFC",
"songColor_2B": "0xFF11B7C6"
}
}
var value = 0;
for (let key in obj) {
if (key === "LyricDuration") value += obj[key]
}
// value === 1750
<button type="submit" id="save" onclick="func1()">Save</button>
const func1 = () => {
const name = document.getElementById("name").value;
const lastname = document.getElementById("lastname").value;
const link = document.getElementById("link").value;
console.log(`Name: ${name}\nLast Name: ${lastname}\n Link: ${link}`)
}