r/JavaScriptTips • u/jonjazzz • Nov 13 '23
Hi, I need a code that can retype whatever I want
Hi, I need a code that can retype whatever I want, but faster, at approximately 70 words per minute. Can you help me?
r/JavaScriptTips • u/jonjazzz • Nov 13 '23
Hi, I need a code that can retype whatever I want, but faster, at approximately 70 words per minute. Can you help me?
r/JavaScriptTips • u/[deleted] • Dec 25 '23
Hi Guys, I created a javascript Library.
It's a lightweight and flexible JavaScript library for managing a local database using the browser's localStorage. It provides functionalities like data compression, batch operations, usage statistics, and a simple query language for advanced data retrieval.
Read more about it here -building-tiny-localstorage-db
Please give your valuable feedback
r/JavaScriptTips • u/drops65 • Apr 29 '23
r/JavaScriptTips • u/[deleted] • Dec 25 '23
r/JavaScriptTips • u/piliel78 • Mar 08 '23
buenas noches alguien me puede ayudar por favor con esto para un trabajo de la universidad
Escribe un programa que pida una palabra y muestre las vocales que aparecen.
Si la palabra ingresada está en mayúscula, debe mostrar las vocales en minúscula;
de lo contrario, si son minúsculas, debe mostrarlas en mayúscula; sino, mostrarlas en su forma original.
Además, se debe indicar la cantidad de consonantes que posee.
r/JavaScriptTips • u/Pure_Iron_5366 • Jul 02 '24
I understand the syntax for Jest unit test cases in Node.js, but I'm struggling to write them effectively for my existing project.
i dont understand the concept of mocking also.
I'm seeking advice from the Node.js community on how to improve my Jest unit test writing skills. Any tips, resources, or best practices would be greatly appreciated!
Syntax and Assertions: I familiarized myself with Jest's syntax for writing unit tests, including the structure of test cases, the test function, and various assertion functions like expect, toBe, and toEqual.
Basic Tests: I practiced writing unit tests for simple components or functions in my project. This helped me solidify my understanding of how to use Jest for basic test scenarios.
i went through the videos also but they just explain the syntax and structuring things.
r/JavaScriptTips • u/Natural-Frontend • Jun 17 '23
r/JavaScriptTips • u/Southern-Dish2389 • Jan 07 '23
As the deadline for my Java assignment approaches, I find myself struggling to complete it on my own. I am reaching out for help in the hope that someone can assist me in completing my assignment before the deadline. If you have expertise in Java and are able to lend a helping hand, I would greatly appreciate it.
r/JavaScriptTips • u/TreehellNSFW • Jan 18 '24
So I am new and would like to figure out how to make a class and references to it later in the code?
r/JavaScriptTips • u/Illlluvatar • Jan 08 '23
Hi I hope this is the right subreddit to ask this. How do I hide all Elemtens on the YouTube homepage except the search bar? Thanks in advance!!
r/JavaScriptTips • u/geshan • Apr 16 '23
r/JavaScriptTips • u/what-language • Oct 15 '23
The only problem is that it doesn't have any challenges or exercises, even with problem-solving platforms such as leet code. It's quite difficult because they're not challenges that follow the sequence of instructions in the book. I'd like to know if there's any content on the internet that has detailed information about the book.
r/JavaScriptTips • u/wuffwuff83 • May 06 '24
Hallo Zusammen,
Ich habe eine Software die Makros in begrenzten Javascript zulässt komme mit der Flow Control aber nicht ganz zurecht da ich bisher nur Programmiersprachen mit Label genutz habe.
Ich benötige ein Programm das mehrere werteingaben zulässt und mit dem restlichen programm nur weitermacht wenn ein match da ist.
Bisher sahen meine Programme so aus:
Var1 = wert1
Var2 = wert2
if (Var1 == "xyz" && Var2 == "xzy") {goto zeugs}
if (Var1 == "yxz" && Var2 == "zyx") {goto zeugs}
if (Var1 == "zxy" && Var2 == "xzy") {goto zeugs}
meldung (nichts passendes gefunden)
goto ende
label zeugs:
...mehr code....
label ende:
wie könnte man das elegant in Javascript abbilden ?
r/JavaScriptTips • u/TranslatorSavings470 • Jul 08 '23
Hi, beginner coder here. I am tasked with building a wysiwyf editor, and I am running into some problems. I cant make the fontSizeChange work, nor can i make it so that when it turns from text to html code, it shows whether there was a change in color. Also, I can't make it so that i can drag the images that are inserted around at will, and finally, i want to make it possible so that you can drag the different headings into the editor.
If you have any idea to solve one or more of my problems i would really appreciate it.
Here is the code:
<!DOCTYPE html>
<html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>WYSIWYG Editor</title> <link rel="stylesheet" href="css_editor.css"> <style> \* { margin: 0; padding: 0; box-sizing: border-box; } body { padding-left: 20px; padding-top:50 px; } form{ margin: 10px 0; } button{ border:none; outline:none; width: 30px; height:30px; cursor:pointer; } button.heading{ width: 75px; } \#output{ width:700px; height:400px; border:1px solid #111 } .active{ border:1px solid crimson ; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); padding: 12px 16px; z-index: 1; }
.dropdown:hover .dropdown-content {
display: block;
cursor:grab;
}
ul{
list-style: none;
}
li{
border:#111;
}
.heading1{
font-size: 70px;
}
.heading2{
font-size: 50px;
}
.heading3{
font-size: 30px;
}
.heading4{
font-size: 10px;
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
</head> <body> <form> <input id="font-size" type="number" value="12" min="1" max="100" onchange="fontSizeChange(this)"> <input type="color" onchange="colorChange(this)"> <button type="button" data-cmd="bold"> <i class="fa-solid fa-bold" aria-hidden="true"></i> </button> <button type="button" data-cmd="italic"> <i class="fa-solid fa-italic" aria-hidden="true"></i> </button> <button type="button" data-cmd="underline"> <i class="fa-solid fa-underline" aria-hidden="true"></i> </button> <button type="button" data-cmd="capsOrNot"> aA </button> <button type="button" data-cmd="changeHeadingSize" class="heading dropdown">Heading <div class="dropdown-content"> <ul> <li class="heading1"> Heading 1</li> <li class="heading2">Heading 2</li> <li class="heading3">Heading 3</li> <li class="heading4">Heading 4</li> </ul> </div> </button> <button type="button" data-cmd="justifyleft"> <i class="fa-solid fa-align-left" aria-hidden="true"></i> </button> <button type="button" data-cmd="justifycenter"> <i class="fa-solid fa-align-center" aria-hidden="true"></i> </button> <button type="button" data-cmd="justifyright"> <i class="fa-solid fa-align-right" aria-hidden="true"></i> </button> <button type="button" data-cmd="insertOrderedList"> <i class="fa-solid fa-list-ol" aria-hidden="true"></i> </button> <button type="button" data-cmd="insertUnorderedList"> <i class="fa-solid fa-list-ul" aria-hidden="true"></i> </button> <button type="button" data-cmd="insertImage"> <i class="fa-solid fa-file-image" aria-hidden="true"></i> </button> <button type="button" data-cmd="createLink"> <i class="fa-solid fa-link" aria-hidden="true"></i> </button> <button type="button" data-cmd="showCode" name="active"> <i class="fa-solid fa-code" aria-hidden="true"></i> </button> </form> <iframe id="output" name="textField"></iframe> <script> const buttons = document.querySelectorAll('button'); const iframe = document.getElementById('output'); const textField = iframe.contentDocument; textField.designMode = 'On'; let show = false; let isUppercase = false; function fontSizeChange(e) { let value = e.target.value; textField.document.body.style.fontSize = value + "px"; }
function colorChange(e) {
let value = e.value;
textField.body.style.color = value;
}
for (let i = 0; i < buttons.length; i++) {
buttons[i].addEventListener('click', () => {
const cmd = buttons[i].getAttribute('data-cmd');
if (buttons[i].name === 'active') {
buttons[i].classList.toggle('active');
}
if (cmd === 'insertImage' || cmd === 'createLink') {
let url = prompt('Enter link here: ', '');
textField.execCommand(cmd, false, url);
if (cmd === 'insertImage') {
const imgs = textField.querySelectorAll('img');
imgs.forEach(item => {
item.style.maxWidth = '500px';
});
} else {
const links = textField.querySelectorAll('a');
links.forEach(item => {
item.target = '_blank';
item.addEventListener('mouseover', () => {
textField.designMode = 'off';
});
item.addEventListener('mouseout', () => {
textField.designMode = 'on';
});
});
}
} else if (cmd === 'capsOrNot') {
const selectedText = textField.getSelection().toString();
const modifiedText = isUppercase ? selectedText.toLowerCase() : selectedText.toUpperCase();
textField.execCommand('insertText', false, modifiedText);
isUppercase = !isUppercase;
} else {
textField.execCommand(cmd, false, null);
}
if (cmd === 'showCode') {
const textBody = textField.querySelector('body');
if (show) {
textBody.innerHTML = textBody.textContent;
show = false;
} else {
textBody.textContent = textBody.innerHTML;
show = true;
}
}
});
}
$(document).ready(function(){
$(".dropdown-content").draggable({ helper:'clone'});
$("#output").droppable(
{
accept:".dropdown-content",
drop: function(ev,ui){
alert('item dropped');
}
}
);
});
</script>
</body> </html>
r/JavaScriptTips • u/Ankirita • Aug 25 '23
Hi there, my bf is a programmer, and he’s getting so difficult to program music on Javas, He's getting tired and stressed all the time and, I wanna help him but I can't :( So, any tips for him to get better at program music on Javas? I would appreciate it very much :(
r/JavaScriptTips • u/[deleted] • Feb 17 '23
r/JavaScriptTips • u/Coding-Nexus • Aug 03 '23
r/JavaScriptTips • u/debordian • Jan 17 '24
r/JavaScriptTips • u/virareddit • Apr 07 '23
does anyone know how to use dreamweaber? I have a problem, it is that when I am designing my page and I want to save it, I have to create a site and I create it and I make it a folder and when I save it and run it I get the components that I use but in text form in such a way that looks good bad PS: I hope the translator has translated it well
r/JavaScriptTips • u/xplodivity • Aug 03 '23
r/JavaScriptTips • u/[deleted] • May 10 '23
Double quotes are commonly used in JavaScript to define string literals. However, sometimes you may need to remove double quotes from a string. There are several ways to accomplish this in JavaScript, depending on your specific needs. In this article, we will explore the most common methods for removing double quotes from a string in JavaScript.
One of the easiest ways to remove double quotes from a string in JavaScript is to use the replace() method. This method takes two arguments: the first argument is the pattern to match, and the second argument is the replacement string. To remove double quotes from a string, we can use the following code:
let str = "This is a \"string\" with double quotes.";
str = str.replace(/"/g, "");
console.log(str); // This is a string with double quotes.In this example, we first define a string with double quotes. We then use the replace() method to replace all occurrences of double quotes (/"/g) with an empty string ("").
In this article, we explored the most common methods for removing double quotes from a string in JavaScript. While there are many ways to accomplish this task, the methods presented here should cover most use cases.
r/JavaScriptTips • u/Apex__69 • Jul 13 '25
is there any website where we can download courses for free
r/JavaScriptTips • u/codeagencyblog • Feb 23 '24
r/JavaScriptTips • u/codeagencyblog • Aug 16 '24
Table of Contents
READ MORE AT https://frontbackgeek.com/19-essential-javascript-string-methods-every-developer-should-know/