What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-03-21 22:15:23
Slice Example
/"slice() copies or extracts a given number of elements to a new array"/ let weatherConditions = ['rain', 'snow', 'sleet', 'hail', 'clear']; let todaysWeather = weatherConditions.slice(1, 3); // todaysWeather equals ['snow', 'sleet']; // weath... Add solution -
Javascript 2022-03-12 14:00:06
discord.js nickname command
const Discord = require('discord.js') exports.run = async (client, message, args) => { if (!message.member.hasPermission('MANAGE_NICKNAMES')) return message.reply(`You cannot use this command as you do not have the \`MANAGE_NICKNAMES\` permission`... Add solution -
Javascript 2022-03-11 20:00:13
hex to rgba in js
hexToRGB(hex: string, alpha: string) { const r = parseInt(hex.slice(1, 3), 16); const g = parseInt(hex.slice(3, 5), 16); const b = parseInt(hex.slice(5, 7), 16); if (alpha) { return `rgba(${r}, ${g}, ${b}, ${alpha})`; } else { return `... Add solution -
Javascript 2022-02-09 21:55:08
how to make data title case in discord js
function titleCase(str) { return str .split(' ') .map((word) => word[0].toUpperCase() + word.slice(1).toLowerCase()) .join(' '); } console.log(titleCase("I'm a little tea pot")); // I'm A Little tea Pot Add solution -
Javascript 2022-01-26 05:02:14
find capital word in string javascript
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2022-01-23 00:20:50
return first letter of string javascript in uppercase
//capitalize only the first letter of the string. function capitalizeFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); } //capitalize all words of a string. function capitalizeWords(string) { return string.repl... Add solution -
Javascript 2021-12-23 16:08:11
javascript how to get every element after the 1st in an array
var arguments = ['One', 'Two', 'Three']; var middle = arguments.slice(1, -1); // will take away the 1st from the start and the 1st from the end console.log(middle); // once logged it will only show 'Two' Add solution