Category "javascript"

Javascript: check multiple elements in array [closed]

I have an array: a=[10,11,12,13]. How can check elements from a[0] to a[2] if they >0 in the shortest way and don't use for loop? Does anyo

regular expression to match exactly 5 digits

testing= testing.match(/(\d{5})/g); I'm reading a full html into variable. From the variable, want to grab out all numbers with the pattern of exactly 5 digit

Style dd and dt tags with bootstrap

I created dt and dd tags in my javaScript. I also have some styling for them in my CSS file. But I am switching to bootstrap, how can I style them? const pr

How to use filter with two Observables and return only one in rxjs

I have a part of code that checks if two observables are up to date and returns the second observable if they are: combineLatest([$source1, $source2]).pipe( f

Read a file content as a string in Vue

Some other post respond to the same problem (here, here and here) by using raw-loader but from my understanding it is deprecated for webpack v5 (but I'm not sur

How to create a test Unit method for a get request that fetches Data from Database(MongoDB)?

Get request method in tasks.js file const { Task } = require('../model/Tasks.js') const asyncWrapper =require('../middleware/async') const getTask = asyncWrapp

Complex top level parents by param of the lowest child Saving your hierarchy and without repeating his hierarchy

Good evening. Today I am looking for a recursive function that will help me find all the greatest parents of a child of an element of a multidimensional array o

Live modification/creation of file/data with pure php

For example [['Inflammation'],['Noxious stimuli cause resident effector cells to secrete cytokines<br>Cytokines ↑ vascular dilation & permeabili

Javascript AWS S3.upload gives a promise?

The AWS instructions on S3 uploading (https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3/ManagedUpload.html) would suggest that the following should wor

Nextjs: Objects are not valid as a React child (found: object with keys {...})

I'm building a form with multiple pages, but my button to toggle the page throws an error. Objects are not valid as a React child (found: object with keys {0,

How to get data from MySQL and after 30 second fetch it again in Node.js?

I'm trying to do is fetching the data according to timestamp from DB once (call it origin) and wait for 30sec fetch it again with same query(call it recent) in

Showing data called into Select in DIV

I can't speak English well and I use google translate. If there is something you do not understand, please ask. My problem is this: For example, in the code blo

How can i connect Huobi websocket from client browser

When I try to connect my React client to Huobi websocket, connection immediately closing. In nodejs I can connect to Huobi websocket without any configuration.

How to download PDF automatically on click instead of opening it in new tab using js?

I have an input URL with which I want to download pdf file directly without viewing it in a new tab or on the same tab, I have tried following things till now b

How to create multiple HTML elements from an Array?

I have a simple site that is getting a list of books from the Google Books API. I have a separate file called scripts.js that is getting all the book informatio

vscode: autoformat conflicts with linter

I started a quasar.js v2 (vue3) project today. I messed up something in my vs code project because, for example, code will not compile becausee of extra semicol

Getting content that are not wrapped in tags

Here's what I'm dealing with; I don't have control of it. <div id="foo"> <div>etc.</div> <div>etc.</div> (foobar) (<a

Chrome asks if an application should be opened

We have a website that allows the user to download and open a Word file. Chrome started recently opening an annoying popup when the users downloads the Word The

Object() vs. Function()

It is my understanding that pretty much everything in JS is an object and that constructors are one way to make a new object. I know that data types like Array,

How to ignore onBlur event call when enter key is pressed on async-react-select

I am using Async component of react-select for inline editing in ag-grid. There is a event available in react-select component (onChange) which captures the val