r/JavaScriptTips • • Aug 20 '23

“Atomic Habits” and Learning to Code.

1 Upvotes

Hello all, I have written a post about productivity and motivation when learning to code and developing programming skills. It is based on ideas I found in James Clear's atomic habits. Please reach out with thoughts, ideas, criticisms or banter!

https://open.substack.com/pub/thecodingapprentice/p/atomic-habits-and-learning-to-code?utm_campaign=post&utm_medium=web


r/JavaScriptTips • • Aug 06 '23

Javascript Variable Scope in 2.6 Minutes…

1 Upvotes

Here is a post about scoping and javascript variables. Differences in scope mean differences in accessibility and usability for the variables that we declare. I hope this post helps everyone learn or brush up on their knowledge when it comes to declaring variables. Please feel free to reach out with any questions, queries, comments or banter!

https://thecodingapprentice.substack.com/p/javascript-variable-scope-in-26-minutes?sd=pf


r/JavaScriptTips • • Nov 13 '23

Hi, I need a code that can retype whatever I want

0 Upvotes

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 • • Dec 25 '23

Building tiny-localstorage-db: A Lightweight Local Database for Browser Storage

1 Upvotes

Hi Guys, I created a javascript Library.

tiny-localstorage-db

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 • • Apr 29 '23

How To Easily Create A Basic Web Editor In Angular

Thumbnail
learnjavascripts.com
0 Upvotes

r/JavaScriptTips • • Dec 25 '23

NodeJS Library Management System - #01 Introduction & Features Discussion

Thumbnail
youtu.be
1 Upvotes

r/JavaScriptTips • • Mar 08 '23

trabajo de la universidad

0 Upvotes

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 • • Jul 02 '24

How to write jest unit test cases for nodejs.

1 Upvotes

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 • • Jun 17 '23

Become a web developer yourself | First part of HTML presentation

Thumbnail
youtube.com
1 Upvotes

r/JavaScriptTips • • Jan 07 '23

Seeking Help with Java Assignment

1 Upvotes

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 • • Jan 18 '24

new to java and i need help on how to create a name

0 Upvotes

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 • • Jan 08 '23

YouTube

1 Upvotes

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 • • Apr 16 '23

How to use class names NPM package to add multiple class names to a React.js component

Thumbnail
geshan.com.np
0 Upvotes

r/JavaScriptTips • • Oct 15 '23

why the book JavaScript the definitive guide has no exercises.

1 Upvotes

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 • • May 06 '24

Flusskontrolle ohne Label

0 Upvotes

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 • • Jul 08 '23

HELP PLEASE!!

1 Upvotes

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 • • Aug 25 '23

Music on JavaScript

0 Upvotes

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 • • Feb 17 '23

JavaScript interview questions #32 subscribe for more #javascript #shorts #webdevelopment #frontenddeveloper #backenddeveloper #leetcode #interview #coding #codinginterview #codingshorts #codinginterviewquestions #viral #tipoftheweek #tipoftheday #reels #job #jobinterview #short #didyouknow #web

Thumbnail
youtube.com
0 Upvotes

r/JavaScriptTips • • Aug 03 '23

A step-by-step guide to building your own REST API with JavaScript

Thumbnail
youtu.be
1 Upvotes

r/JavaScriptTips • • Jan 17 '24

How to Convert a Number to a String in JavaScript

Thumbnail 7.dev
0 Upvotes

r/JavaScriptTips • • Apr 07 '23

someone expert in dreamweaber?

0 Upvotes

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 • • Aug 03 '23

Type checking in JavaScript without using Typescript...but should you?

Thumbnail
youtube.com
1 Upvotes

r/JavaScriptTips • • May 10 '23

How to remove double quotes from string in JS?

1 Upvotes

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.

Using String.replace()

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 • • Jul 13 '25

download courses for free

0 Upvotes

is there any website where we can download courses for free