How to set value of multidimential object when name path is stored in array of unknown length?

I have an array of unknown length which defines the path to content I want to alter in a object.

This is what I want.

let updatedContent = "Hello World!";
let myArray = ["layer1","layer2","layer3"];
myObject["layer1"]["layer2"]["layer3"] = updatedContent;

My problem is myArray is of unknown length. What is the best way to update a value in the object?

Aborting multiple-step promise chains with custom error handlers

I’m writing a multi-step async sequence that involves different possible errors at each step. I want to abort the whole sequence if an error occurs.

I am trying to express this as a linear sequence using Promise.then() and Promise.catch(). Here is the pseudocode:

step1()
.catch(errorAtStep1 => handlerErrorAtStep1)
.then(resultOfStep1 => step2(resultOfStep1))
.catch(errorAtStep2 => handlerErrorAtStep2)
.then(resultOfStep2 => step3(resultOfStep2))
...

I understand that I need to throw something in each error handler to avoid getting back into the then(result) parts. When I throw, though, the execution ends up in the next catch(error) block, which was expecting an error that’s related to its corresponding step, not that other thing that I threw.

My question is: what are clean ways to handle this, that would minimize distraction when reading the code?

I came up with this class:

class AbortChainError extends Error {
  static chain(handler) {
    return function(error) {
      if (error instanceof AbortChainError) throw error
      handler(error)
      throw new AbortChainError()
    }
  }
}

that allows the catch() blocks to be written as:

.catch(AbortChainError.chain(errorAtStep2 => handlerErrorAtStep2))

with the additional need to write a final, empty catch() block at the end of the sequence.

Can we do better?

JavaScript ast:how to Convert switch to if statement in JavaScript?

hey guys!How to use ast convert code1 to code2?

I’ve been given a task that I have pretty much solved myself but there is some small correction that needs to be made and I need a help from someone to point me out of how to merge nodes!
My idea is to deal with ForStatement,find initialization params like ‘var t = 1’, then find the case, but I don’t have a good idea about how to merge nodes,please help me!thanks!
code1:

var a, b, c, d;
for (var t = 1; void 0 !== t;) {
    switch (t) {
        case 1:
            a = 4
            t = 2
            break;
        case 2:
            b = 0
            t = 3;
            break;
        case 3:
            if (c) {
                t = 4
            } else {
                t = 12;
            }
            break;
        case 4:
            t = 5;
            break;
        case 5:
            if (a > b) {
                t = 6;
            } else {
                t = 11;
            }
            break;
        case 6:
            t = 7;
            break;
        case 7:
            if (c > 0) {
                t = 8
            } else {
                t = 9
            }
            break;
        case 8:
            c = Math.floor(c / (b + 1));
            t = 7;
            break;
        case 9:
            t = 10;
            break;
        case 10:
            b++;
            t = 5;
            break;
        case 11:
            d = 'test1'
            break;
        case 12:
            d = 'test2'
            break;
    }
}

code2:

var a, b, c, d;
a = 4;
b = 0;
if (c) {
    while (a > b) {
        while (c > 0) {
            c = Math.floor(c / (b + 1));
        }
        b++;
    }
    d = 'test1'
} else {
    d = 'test2'
}

JavaScript: Get ID from currently dragged CLASS item

My application has multiple stones:
-> “let dragStone”
and one container where one of these stones can be placed:
-> “let putCircleNextStoneField”

function dragFromStoneFieldToNextStoneField() {
    let dragStone = document.querySelector("#stoneField").querySelectorAll(".stone");
    let putCircleNextStoneField = document.querySelector("#nextStoneField");

    dragStone.forEach(stone => {
        stone.classList.add("cursorPointer");
    });

    dragStone.forEach(stone => {
        stone.addEventListener("dragstart", () => {

        });
    });

    putCircleNextStoneField.addEventListener("dragover", e => {
        e.preventDefault();
        putCircleNextStoneField.classList.add("draggedOver");

        putCircleNextStoneField.appendChild(dragStone); //ERROR IN THIS LINE

    });

    putCircleNextStoneField.addEventListener("dragleave", e => {
        putCircleNextStoneField.classList.remove("draggedOver");
    });

    putCircleNextStoneField.addEventListener("drop", e => {
        putCircleNextStoneField.classList.remove("draggedOver");
    });
}

dragFromStoneFieldToNextStoneField();

I want to append the container (parent node) with the stone that is dragged onto it (child node).
The Error code is: “Parameter 1 is not of type ‘Node'”.

I know that the parameter isn’t working beacause the dragStone variable isn’t just a reference to the ID but an array-like object of all child elements which have the CLASS name: “.stone”.

How do I get the reference to the id of the stone that is currently dragged?

How to detect ios dictation status by javascript/DOM

Using ios dictation will trigger beforeinput and input events on DOM page. However, the words will be redundant.

For example, when I speak ‘Test Voice Input‘, I may got continuous input events with data as following:

  1. ‘Test’
  2. ‘Test Voice’
  3. ‘Test Voice Input’

I just want the 3rd result but the above 3 events have no individual property to distinguish them from each other.

Does ios offer some other events to listen to the dictation status?


(I have tried compositionstart and it wasn’t triggered)

How to get id of a dynamic input field in javascript

I want to create a dynamic form where I also apply JavaScript to the dynamic elements.

What I want to do right now is figure out which field (stored in array or whatever data structure) in JavaScript has been clicked so that I can apply the script to that particular field.

The HTML looks like this:

<div class="triple">
  <div class="sub-triple">
    <label>Category</label>
    <input type="text" name="category" id="category" placeholder="Classes/Instances" required/>
    <ul class="cat-list"></ul>
  </div>
  <div class="sub-triple">
    <label>Relation</label>
    <input type="text" name="relation" id="relation" placeholder="Properties" required/>
    <ul class="rel-list"></ul>
  </div>
  <div class="sub-triple">
    <label>Value</label>
    <input type="text" name="value" id="value" placeholder="Classes/Instances" required/>
    <ul class="val-list"></ul>
  </div>
</div>

This “triple” div is dynamic and I want to create as many “triples” as the user wants, that also means the input fields of inside the “triple” section increase as well.

I’m confused on how to add javascript to one element of the input. For example I have inputs: category, relation and value and the user wanted 2 or more triples then the input ids could look like category2, relation2 and value2 or something similar to that.

let category = document.getElementById("category");

category.addEventListener("keyup", (e) => {
  removeElements();
  listDown(category, sortedClasses, ".cat-list")

});

If I lets say clicked on category2 for instance how do I tell that to my javascript since these fields are completely dynamic.

Summary: The user is adding repeat sections of triples (containing 3 input elements), where the id of each input element is generated dynamically. My script above works for the first triple section only as the ids are fixed, as for successive “triple” section the id of the fields get changed. How do I identify (see which element has been clicked) and get these dynamic ids

req.user is undefined in express js

I am getting req.user is undefined even if i coded req.user = user.
Here’s the my code…

MIddleware code

 jwt.verify(token, "thisisjwtsecret", async (err, token_decode) => {
   if (!err) {
     const u_id = token_decode._id;
     const userData = await User.findOne({ _id: u_id });
     req.user = {
       name: "swapnil",
     };
     console.log(userData);
   } else {
     return res.json("Invalid token");
   }
 });

App.js

const express = require("express");
const path = require("path");
const flash = require("connect-flash");
const cookieParser = require("cookie-parser");
const hbs = require("hbs");

Here is i am accesing the req.user

const index = async (req, res) => {
  try {
    console.log(req.user);

    const animes = await Anime.find({});
    if (animes.length > 0) {
      res.render("back/animes/index", { animes: animes });
    } else {
      res.json({ msg: "No data found" });
    }
  } catch (error) {
    res.json(error);
  }
};

I am getting req.user is undefined while using req.user to another page

Blank screen from React Context

I am setting up firebase user authentication for a reactjs app. Everything’s been working so far but when I write const {signup} = useAuth() in the file that actually renders the login page, the page turns blank.

There is a context file set up with:

import React, { useContext, useState, useEffect} from 'react'
import {auth} from '../firebase'

const AuthContext = React.createContext()

function useAuth() {
    return useContext(AuthContext)
}

function AuthProvider({children}) {

const[currentUser, setCurrentUser]= useState()

function signup(email, password) {
    return auth.createUserWithEmailAndPassword(email,password)
}

useEffect(() => {
const unsubscribe = auth.onAuthStateChanged(user => {
    setCurrentUser(user)
})
    return unsubscribe
},[]); 

const value = {
    currentUser,
    signup
}
    
  return (
    <AuthContext.Provider value={value}>
    {children}
    </AuthContext.Provider>
  )
}

export {useAuth, AuthProvider}

With my RenderPage everything is working correctly, it’s just a basic JSX/HTML return function with

import {useAuth, AuthProvider} from '../Contexts/AuthContext' 
import React, { useState, useRef } from "react";

function RenderPage() {
 return( 
<AuthProvider>
<h1>Generic text</h1>
<AuthProvider>)}
export default RenderPage;

And everything works perfectly,

But then when I put in the line const {signup} = useAuth() to make it:

import {useAuth, AuthProvider} from '../Contexts/AuthContext' 
import React, { useState, useRef } from "react";

function RenderPage() {
const {signup} = useAuth()
 return( 
<AuthProvider>
<h1>Generic text</h1>
<AuthProvider>
);

The page turns blank.

Does anyone have any idea why this might be? (I already checked the firebase API key and set it up on the realtime database)

Thanks in advance

Troubleshooting Google maps JavaScript API / navigator.geolocation error that wont add a marker location inside a park

Im trying to get my geolocation to show inside a nearby park/conservancy. In this instance when im on the local hiking trail. When using the Google maps Javascript API and the navigator.geolocation from the browser if I’m walking in the street or anywhere inside the typical google maps neighborhood (the grayish areas on google maps) the results are accurate but the second i step into the park/conservancy (a green area) the location stops exactly at the street as if there were a forcefield. The location marker will follow my route along the street like a mime as i walk down the trail but will not cross the plane of the park.

I personally am at a loss as this even happened when i used the Google “find your location” example from the documents for the API. So for this i submit their example as i have followed it to the fullest but wonder if anyone knows a workaround to get my location to show accurately in the park or a reason to why this might be happening?

Phone settings that I have tried on my Samsung Galaxy S21 Ultra are:
WI-FI off, Bluetooth Off, WI-Fi Scanning off and on, Bluetooth scanning off and on.

let map: google.maps.Map, infoWindow: google.maps.InfoWindow;

function initMap(): void {
  map = new google.maps.Map(document.getElementById("map") as HTMLElement, {
    center: { lat: -34.397, lng: 150.644 },
    zoom: 6,
  });
  infoWindow = new google.maps.InfoWindow();

  const locationButton = document.createElement("button");

  locationButton.textContent = "Pan to Current Location";
  locationButton.classList.add("custom-map-control-button");

  map.controls[google.maps.ControlPosition.TOP_CENTER].push(locationButton);

  locationButton.addEventListener("click", () => {
    // Try HTML5 geolocation.
    if (navigator.geolocation) {
      navigator.geolocation.getCurrentPosition(
        (position: GeolocationPosition) => {
          const pos = {
            lat: position.coords.latitude,
            lng: position.coords.longitude,
          };

          infoWindow.setPosition(pos);
          infoWindow.setContent("Location found.");
          infoWindow.open(map);
          map.setCenter(pos);
        },
        () => {
          handleLocationError(true, infoWindow, map.getCenter()!);
        }
      );
    } else {
      // Browser doesn't support Geolocation
      handleLocationError(false, infoWindow, map.getCenter()!);
    }
  });
}

function handleLocationError(
  browserHasGeolocation: boolean,
  infoWindow: google.maps.InfoWindow,
  pos: google.maps.LatLng
) {
  infoWindow.setPosition(pos);
  infoWindow.setContent(
    browserHasGeolocation
      ? "Error: The Geolocation service failed."
      : "Error: Your browser doesn't support geolocation."
  );
  infoWindow.open(map);
}

Js does not activate when using splash on duproprio.com

I use splash for parse page code on my target, but Js is not rendering. The only thing i want with splash it’s to get number on total page like the search Pagination not appear without Js. If you find an other tips for parse the number of total page or splash render fixing, you will be top!

Tks 😀

Link to parse
“https://duproprio.com/fr/rechercher/liste?search=true&is_for_sale=1&with_builders=1&parent=1&pageNumber=1&sort=-published_at”

How can I select the variable of inside of script tag as JSON value?

https://www.canparkavm.com.tr/tr/markalar

As i said at title, how can i access/convert JavaScript variable as JSON value on Python using the BeautifulSoup and requests libraries?

I tried this topic for solve my problem but did not worked actually: Extract JSON from HTML Script tag with BeautifulSoup in Python

        from bs4 import BeautifulSoup        
        import requests, json
        from subprocess import check_output
                def main():
                headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36'}
                url = "https://www.canparkavm.com.tr/tr/markalar"
                req = requests.get(url,headers=headers)
                bs4 = BeautifulSoup(req.content,"lxml")
                data = bs4.find("body").find("script").find_next("script")
                with open('temp.js','w') as f:
                     f.write('stores = {};n'+data.text.strip()+'nprocess.stdout.write(JSON.stringify(stores));')
                window_init_state = check_output(['node','temp.js'])
                print(json.loads(window_init_state))
    main()

Script tag is inside of HTML.
This is script tag which i tried to scrap JSON value from stores variable:

<script>

    var language = "tr";
    var stores = [
  {
    "store_categories": [
      {
        "store_category_tr_tags": [],
        "store_category_en_tags": [],
        "_id": "4yc8Q95d-",
        "store_category_name_tr": "Yeme & İçme",
        "store_category_name_en": "Food & Beverage",
        "store_category_mallid": "NkYFwYyO-"
      }
    ],
    "store_tags": [],
    "store_locations": [
      {
        "location_pin": {
          "z": 0,
          "x": 7475,
          "y": 4043
        },
        "location_serviceids": [],
        "location_belongs_to_nodes": [
          "B1ZlzrSdA0F"
        ],
        "_id": "EJ1xCinc-OZ",
        "location_id": "K0_store_43",
        "location_mallid": "NkYFwYyO-",
        "location_floorid": {
          "floor_number": 0,
          "_id": "4Jk1uMxdW",
          "floor_name_tr": "Zemin Kat",
          "floor_name_en": "Ground Floor"
        },
        "location_storeid": "NJgYCfWg_-"
      }
    ],
    "store_promotions": [
      "41yxPW1hB"
    ],
    "store_will_use_big_logo": false,
    "_id": "NJgYCfWg_-",
    "store_slug": "alacati-muhallebicisi",
    "store_mallid": "NkYFwYyO-",
    "store_brandid": {
      "_id": "4ym42U_JOb",
      "brand_id": 2271,
      "brand_name": "Alaçatı Muhallebici",
      "brand_logo": "https://d3heiv85u05n2u.cloudfront.net/images/brands/2271_low.jpg?1429088370",
      "brand_web": "http://www.alacatimuhallebicisi.com",
      "brand_whitescale_logo": "https://d3heiv85u05n2u.cloudfront.net/images/brands/2271_whitescale_low.png?1482761569",
      "brand_logo_high": "https://d3heiv85u05n2u.cloudfront.net/images/brands/2271_original.jpg?1429088370",
      "brand_whitescale_logo_high": "https://d3heiv85u05n2u.cloudfront.net/images/brands/2271_whitescale_original.png?1482761569"
    },
    "store_name": "ALAÇATI MUHALLEBİCİSİ",
    "store_email": "",
    "store_web": "http://www.alacatimuhallebicisi.com",
    "store_phone": "0216 504 51 18",
    "store_description_tr": "",
    "store_description_en": "",
    "store_primary_image": {
      "main": "https://s3-eu-central-1.amazonaws.com/klepierre/images/store_primary_image/NJgYCfWg_--main.jpeg?1470234948279"
    }
  },
  {
    "store_categories": [
      {
        "store_category_tr_tags": [],
        "store_category_en_tags": [],
        "_id": "NkSYmq9db",
        "store_category_name_tr": "Sinema & Eğlence",
        "store_category_name_en": "Fun",
        "store_category_mallid": "NkYFwYyO-"
      }
    ],
    "store_tags": [],
    "store_locations": [
      {
        "location_pin": {
          "z": 3,
          "x": 1832,
          "y": 3989
        },
        "location_serviceids": [],
        "location_belongs_to_nodes": [
          "HkBHMHBORCY"
        ],
        "_id": "Vyy4Cj29Zdb",
        "location_id": "K3_store_123q124",
        "location_mallid": "NkYFwYyO-",
        "location_floorid": {
          "floor_number": 3,
          "_id": "V1bjvfxuZ",
          "floor_name_tr": "Kat 3",
          "floor_name_en": "Floor 3"
        },
        "location_storeid": "VJWEJQWxdZ"
      },
      {
        "location_pin": {
          "z": 3,
          "x": 9885,
          "y": 3872
        },
        "location_serviceids": [],
        "location_belongs_to_nodes": [
          "SkVIGSB_R0F"
        ],
        "_id": "NyJS0o25b_Z",
        "location_id": "K3_store_136q138",
        "location_mallid": "NkYFwYyO-",
        "location_floorid": {
          "floor_number": 3,
          "_id": "V1bjvfxuZ",
          "floor_name_tr": "Kat 3",
          "floor_name_en": "Floor 3"
        },
        "location_storeid": "VJWEJQWxdZ"
      }
    ],
    "store_promotions": [
      "EkC2w99hS",
      "r1X-WHouN"
    ],
    "store_will_use_big_logo": false,
    "_id": "VJWEJQWxdZ",
    "store_slug": "atlantis-fun-city",
    "store_mallid": "NkYFwYyO-",
    "store_brandid": {
      "_id": "ByPu9oyvB",
      "brand_id": 5431,
      "brand_name": "Atlantis Fun City",
      "brand_logo": "https://ams3.digitaloceanspaces.com/cinebrand/images/brand/brand_logo/6d1a86e9-3d27-4dfa-9318-dc8855dcf839.png?1568811042923",
      "brand_logo_high": "https://ams3.digitaloceanspaces.com/cinebrand/images/brand/brand_logo/0fb05193-2af0-4607-be17-a965d1b509c5.png?1568811042667"
    },
    "store_name": "ATLANTİS FUN CITY",
    "store_email": "[email protected]",
    "store_web": "",
    "store_phone": "0544 258 34 22 ",
    "store_description_tr": "",
    "store_description_en": "",
    "store_primary_image": {
      "main": "https://s3-eu-west-1.amazonaws.com/canpark/images/store_primary_image/VJWEJQWxdZ-main.jpeg?1560243207859"
    }
  },
  {
    "store_categories": [
      {
        "store_category_tr_tags": [],
        "store_category_en_tags": [],
        "_id": "Eyvibc5uZ",
        "store_category_name_tr": "Hazır Giyim",
        "store_category_name_en": "Clothing",
        "store_category_mallid": "NkYFwYyO-"
      }
    ],
    "store_tags": [],
    "store_locations": [
      {
        "location_pin": {
          "z": 1,
          "x": 8974,
          "y": 3054
        },
        "location_serviceids": [],
        "location_belongs_to_nodes": [
          "HJUfGrrOR0F"
        ],
        "_id": "EkhZAi3qZ_b",
        "location_id": "K1_store_79",
        "location_mallid": "NkYFwYyO-",
        "location_floorid": {
          "floor_number": 1,
          "_id": "VkeCvMxOZ",
          "floor_name_tr": "Kat 1",
          "floor_name_en": "Floor 1"
        },
        "location_storeid": "Vk7jAMZxOW"
      }
    ],
    "store_promotions": [
      "Sy8FFoc2B",
      "HywcrnjRH"
    ],
    "store_will_use_big_logo": false,
    "_id": "Vk7jAMZxOW",
    "store_slug": "aker",
    "store_mallid": "NkYFwYyO-",
    "store_brandid": {
      "_id": "4Jzz28OJub",
      "brand_id": 535,
      "brand_name": "Aker",
      "brand_logo": "https://d3heiv85u05n2u.cloudfront.net/images/brands/535_low.jpg?1376916442",
      "brand_web": "http://www.aker.com.tr",
      "brand_whitescale_logo": "https://d3heiv85u05n2u.cloudfront.net/images/brands/535_whitescale_low.png?1472804453",
      "brand_logo_high": "https://d3heiv85u05n2u.cloudfront.net/images/brands/535_original.jpg?1376916442",
      "brand_whitescale_logo_high": "https://d3heiv85u05n2u.cloudfront.net/images/brands/535_whitescale_original.png?1472804453"
    },
    "store_name": "Aker",
    "store_email": "[email protected]",
    "store_web": "http://www.aker.com.tr",
    "store_phone": "0216 999 37 83",
    "store_description_tr": "",
    "store_description_en": "",
    "store_primary_image": {
      "main": "https://s3-eu-central-1.amazonaws.com/klepierre/images/store_primary_image/Vk7jAMZxOW-main.jpeg?1470234918440"
    }
  },
  {
    "store_categories": [
      {
        "store_category_tr_tags": [],
        "store_category_en_tags": [],
        "_id": "Eyvibc5uZ",
        "store_category_name_tr": "Hazır Giyim",
        "store_category_name_en": "Clothing",
        "store_category_mallid": "NkYFwYyO-"
      }
    ],
    "store_tags": [],
    "store_locations": [
      {
        "location_pin": {
          "z": 1,
          "x": 4842,
          "y": 3029
        },
        "location_serviceids": [],
        "location_belongs_to_nodes": [
          "ByK-GHSdCCK"
        ],
        "_id": "4kz-Co2cWuZ",
        "location_id": "K1_store_86",
        "location_mallid": "NkYFwYyO-",
        "location_floorid": {
          "floor_number": 1,
          "_id": "VkeCvMxOZ",
          "floor_name_tr": "Kat 1",
          "floor_name_en": "Floor 1"
        },
        "location_storeid": "EkNoCfZlub"
      }
    ],
    "store_promotions": [
      "VyLvwZy2r"
    ],
    "store_will_use_big_logo": false,
    "_id": "EkNoCfZlub",
    "store_slug": "altinyildiz-classics",
    "store_mallid": "NkYFwYyO-",
    "store_brandid": {
      "_id": "V1nYjVTsN",
      "brand_id": 4363,
      "brand_name": "Altınyıldız Classics",
      "brand_logo": "https://d3heiv85u05n2u.cloudfront.net/images/brands/4363_low.jpg?1521447270",
      "brand_logo_high": "https://d3heiv85u05n2u.cloudfront.net/images/brands/4363_original.jpg?1521447270",
      "brand_whitescale_logo": "https://ams3.digitaloceanspaces.com/cinebrand/images/brand/brand_whitescale_logo/ae8e1fff-241b-4046-9943-be8ffa704cec.png?1559033647723",
      "brand_whitescale_logo_high": "https://ams3.digitaloceanspaces.com/cinebrand/images/brand/brand_whitescale_logo/8008a25a-95a3-4da8-8b56-90340ccadfd0.png?1559033633724",
      "brand_web": ""
    },
    "store_name": "Altınyıldız Classics",
    "store_email": "[email protected]",
    "store_web": "",
    "store_phone": "0216 519 16 06",
    "store_description_tr": "",
    "store_description_en": "",
    "store_primary_image": {
      "main": "https://s3-eu-west-1.amazonaws.com/canpark/images/store_primary_image/EkNoCfZlub-main.jpeg?1559032279151"
    }
  },
  {
    "store_categories": [
      {
        "store_category_tr_tags": [],
        "store_category_en_tags": [],
        "_id": "4yc8Q95d-",
        "store_category_name_tr": "Yeme & İçme",
        "store_category_name_en": "Food & Beverage",
        "store_category_mallid": "NkYFwYyO-"
      }
    ],
    "store_tags": [],
    "store_locations": [
      {
        "location_pin": {
          "z": 3,
          "x": 2274,
          "y": 4510
        },
        "location_serviceids": [],
        "location_belongs_to_nodes": [
          "rkESfSBu0RY"
        ],
        "_id": "41R7Rs3cbOb",
        "location_id": "K3_store_125",
        "location_mallid": "NkYFwYyO-",
        "location_floorid": {
          "floor_number": 3,
          "_id": "V1bjvfxuZ",
          "floor_name_tr": "Kat 3",
          "floor_name_en": "Floor 3"
        },
        "location_storeid": "EkNq8ZwTZ"
      }
    ],
    "store_promotions": [],
    "store_will_use_big_logo": false,
    "_id": "EkNq8ZwTZ",
    "store_slug": "arden",
    "store_brandid": {
      "_id": "NJpvrWvpW",
      "brand_id": 3433,
      "brand_name": "Arden",
      "brand_logo": "http…</script>

Fastest way to make a million POST requests to a cloud function?

I have an array with a length of one million. Each element is a string. I have a cloud function that takes a string and processes it. What is the fastest way to POST all million strings in my array to the cloud function? I don’t care for the response of the cloud function. Ideally, it would POST, not wait for a response, then move on and POST the next one, iterating through the entire list as fast as possible. The issue is apparently with HTTP you cannot not wait for a response. You must wait for the response. Each cloud function takes about 10 seconds to execute. So if I need to wait for each response before moving to the next one, this would take 10 million seconds. Whereas if I could post each and not wait, I could probably run through the entire array in a few seconds.

Promise.All is not a function

I know this question has been answered with comments like Promise.All has to take an array. I am certain I am passing an array of promises here but I am still getting the error. My code is as follows:

const promises = [];
chunkOfAnnotations.forEach(chunk => {
      promises.push(updateCheckRun(id, chunk))
 })
 console.log(promises);
 console.log(global.Promise)
 Promise.All(promises).then(_ => {
      core.info('Check runs updated');
 }, _ => {
      core.setFailed('Error updating check run');
 })

I added some console logs to see what the values are as the first console log outputs this:

[
  Promise { <pending> },
  Promise { <pending> },
  Promise { <pending> },
  Promise { <pending> },
  Promise { <pending> }
]

And the second console log ouputs this: [Function: Promise]

This is for a github action running on Node v14