Sorting an Array of Objects in JavaScript
So, let’s say you have a large Array of Objects, looking like this (snippet) Now you want to sort these Objects in ascending or descending order, based on the key: timestampThat’s very easy, and you …
So, let’s say you have a large Array of Objects, looking like this (snippet) Now you want to sort these Objects in ascending or descending order, based on the key: timestampThat’s very easy, and you …
Here’s a quiz for you (the answer is at the bottom of the post). What is the expected output of these three lines of code, and why is it like that? This isn’t as straight …
This is just a very short post, but this is the absolute simplest JavaScript code I have made, for a coinflip function How simple is that?We define a function that simply returns Heads or Tails …
This article assumes that you have already read the article: https://codelog.network/2020/08/14/discord-js-with-sequelize-and-mysql/ and that you have followed those steps to connect to you MySQL database. The console.log() should have output Logged in to DB. From there …
Note! This assumes that you have a working bot, that uses the command handling from: https://discordjs.guide/command-handling/#individual-command-files, that you use Visual Studio Code (VSC from here) as the editor of choice. (This is what I use, …
I wrote a simple little “game” – Coinflip (aliases coin and flip). It’s really as simple as a random function that returns either 0 or 1, and assigning heads/tails as you want.The code is without …
So, using Discord.js and Node.js have you wondered what guilds your bot is in?If so, the this little snippet might interest you: Replace YOUR_USERID_HERE with your own user id, and CHANNEL_ID with the ID of …