Creating an JavaScript npm package - is there a need to provide a transpiled...
If I have created an npm package (hosted on internal npm repo), do I need to transpile the source code, or can I just copy the source code? The consumers of the npm package are internal front end...
View ArticleWhere did the extra quotes come from, or Why is this failing?
I'm having a problem with this code shown below in that the .join() isn't working properly due to extra quotes (as far as I can tell anyway). I'm inputting a comma separated list and after the...
View ArticleDependency was not found vue.js
I am trying to make an calendar with vue and firebase, an i got this error:This dependency was not found: * @main.js in...
View ArticleHow can I retrieve results from the last 2 days from my firebase database?
I want to retrieve data from only the last 2 days. For this I am inserting the date as a child of locations. This is what my database looks like:As you can see, I'm inserting the date in the third...
View ArticleSave/Looad checkbox state by class name
I am trying to save and load the state of some checkbox: function saveCheckbox () { var a = document.querySelectorAll('input[type="checkbox"]'); var array = []; a.forEach(function(checkBox){...
View ArticleRetrieve the value at a given string path in Ramda
Is there any built-in Ramda function to retrieve the value giving the path as a string? Like:R.path('a.b', {a: {b: 2}}); // I want to get 2 I know that this is possible with path by using an array,...
View ArticleStyled Components - Conditionally render an entire css block based on props
I understand that styles can be conditionally rendered such as:const HelloWorldLabel= styled("div")<{ centered?: boolean }>` display: ${({ centered }) => (centered ? "block" : "flex")};;...
View ArticleGoogle Apps Script JQuery Form
I have a form that I want to popup in Google Sheets. I am using the script editor to achieve this but for some reason this is not working<html> <body> <form action=""> <input...
View ArticleWhy does this React component return the string '0'
When I write this code, I expect my React Component to display nothing. However, it displays '0'. Why is this?import React from "react"; import ReactDOM from "react-dom"; const App = () => { const...
View ArticleFile input on change in vue.js
Using plain HTML/JS, it is possible to view the JavaScript File objects of selected files for an input element like so:<input type="file" id="input" multiple onchange="handleFiles(this.files)">...
View Articleupload image using vue js with form text fields
I started wotking on small project using Vue Js and i would like to add an upload file option in my contact form, i use serialize for the form because i have a lot of input text fields. but it doesn't...
View ArticleTurning into paragraph
I'm turning all characters and whitespaces into spans from paragraph and I'm animating those spans with gsap. The problem is, that the different letters lost connection with words and im getting a bad...
View ArticleHow to check if JavaScript object is JSON
I have a nested JSON object that I need to loop through, and the value of each key could be a String, JSON array or another JSON object. Depending on the type of object, I need to carry out different...
View ArticleHow can I modify this script so that it works when the page first loads AND...
I have a script that loads a dependent drop-down options. I added a part where the dependent drop-down hides whenever there are no options available. The primary drop-down retains the most recent...
View ArticleWhy is a state variable's setter needed as a dependency with useEffect when...
Compare the following two components:Child.jsimport React, { useEffect } from "react"; function Child({ count, setCount }) { // Note: Has parameter useEffect(() => { setInterval(() => {...
View Articlehow to stop atribution to variable in for if
i'm totally newbie in programming - actually i'm learning JavaScript and i have a problem with one task. There is a code below:let myFewNumbers = [1, 4, 3, 2, 4, 5, 1, 2, 5, 9]; let myIndex = 0; for (i...
View ArticleHow to get a click function to work for only the class of the object you...
I have several buttons that use the same class. I am using a click function to make adjustments to the button. The issue I am having is the click function is controlling all of the buttons with the...
View ArticleReturning the result from nestled .then to another function
I can't work out or understand how to return the nestled .then methods resolved value to the function that called it.How can I return the value from the resolved promise that is nestled to the and then...
View ArticleHow to display only a few cards at a time using core javascript?
So, I already have a working code for this requirement in jquery which displays the specified number of cards/divs. For some reason, I have been asked to use pure javascript and I'm not able to achieve...
View ArticleLinking affiliate id to woocommerce order detail admin page
i'm having trouble with something: I'm using ultimate affiliate pro as my affiliate network and woocommerce (as a contact form) to generate leads. I've managed to add in the 'order detail wp wooc admin...
View Article