How to Change Text Color in ApexCharts Label?

How can I change the text color of an ApexCharts label? The problem is the font color is too dark:

enter image description here

I’ve tried for the life of me reading through the ApexCharts docs for a solution, but all I could find was:

chart: {
    foreColor: '#ffffff'
}

I tried it on my chart, but it had no effect.

Here are the complete settings for my chart:

var colors = [ "#008ffb", "#ffc300", "#0acf97", "#fa5c7c", "#e3eaef" ];
var options = {
        chart: {
            foreColor: '#ffffff',
            height: 412,
            type: "pie",
            toolbar: {
                show: true
            }
        },
        series: [ 9890571, 5276166, 4810254, 3823869, 3463197 ],
        labels: [ "CHINO DEVELOPMENT COMPANY", "SC DEVELOPMENT COMPANY, LLC", "RICHLAND, INC.", "SL DEVELOPMENT COMPANY, LLC", "BROOKCAL, LLC" ],
        colors: colors,
        legend: {
            show: !0,
            position: "bottom",
            horizontalAlign: "center",
            verticalAlign: "middle",
            floating: !1,
            fontSize: "14px",
            offsetX: 0,
            offsetY: 7
        },
        responsive: [{
            breakpoint: 600,
            options: {
                chart: {
                    height: 240
                },
                legend: {
                    show: !1
                }
            }
        }]
    },
    chart = new ApexCharts(document.querySelector("#simple-pie"), options);
chart.render();

Exclude certain attributes from object using the populate from mongodb using aggregate

I want to exclude for example email and address using populate() function from mongodb, just get the name from it:

Example:

const results = await Seller.aggregate(aggregatePipeline).exec();
const sellers = await Seller.populate(results, { path: "user" });

When retreiving the user instead of having:

...
user: {
    email: "[email protected]",
    address:{},
    name: "name"
}

I want to only have:

...
user: {
   name: "name"
}

after using Scroll reveal js i am having problems with text overflowing on top of everything

i have this problem where when i use the scroll reveal js (https://scrollrevealjs.org/) in my website every text element i apply the effect overflows on top of every other element and i cant find a fix for it no matter how much i try please someone help me with this. in the screen shot i have attached you can see that when i open the menu the paragraph below the menu is overflowing over the menu and the navbar, i have tried using z-index but nothing really worked.i am new to stack overflow so if i made any mistakes please forgive me.ANY HELP WILL BE GREATLY APPRECIATED.

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <!--=============== FAVICON ===============-->
    <link rel="shortcut icon" href="media/logo.png" type="image/x-icon" />

    <!--=============== BOX ICONS ===============-->
    <link
      href="https://unpkg.com/[email protected]/css/boxicons.min.css"
      rel="stylesheet"
    />

    <!--=============== SCROLL REVEAL ===============-->
    <script src="https://unpkg.com/[email protected]/dist/scrollreveal.min.js"></script>

    <!--==================== GOOGLE FONTS ====================-->
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
    <link
      href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;800;900&display=swap"
      rel="stylesheet"
    />

    <!--=============== CSS ===============-->
    <link rel="stylesheet" href="assets/css/style.css" />

    <!--=============== META TAGS ===============-->
    <meta name="title" content="STUDIO 69" />
    <meta
      name="description"
      content="Studio 69 Architects is a Bangalore-based architectural practice with a strong focus on design. After several years of working with some of India’s respected architectural firms, Ganesh Kumar established Studio 69 Architects in 1995. Since then, Studio 69 has completed a number of successful projects across India-ranging from residential, commercial, civic projects as well as interiors. Our team are experienced, innovative, and committed to achieving an outstanding result for every project. We treat every project with great important regardless how small, large, simple, or complex. We are determined to ensure that the completed design and built project satisfies the client’s needs, objectives an aspirations. The founding principle of Studio 69 is to address human needs through built form. We design to cater to the requirements of the client by curating a functional and aesthetical environment that are commercially smart."
    />
    <meta name="keywords" content="" />

    <title>Studio 69</title>

    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script
      async
      src="https://www.googletagmanager.com/gtag/js?id=__________"
    ></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag() {
        dataLayer.push(arguments);
      }
      gtag("js", new Date());

      gtag("config", "__________");
    </script>
  </head>

  <body>
    <main class="main">
      <!--==================== HEADER ====================-->
      <header class="header">
        <nav class="nav container">
          <a href="#" class="logo"
            ><img src="media/logo.png" alt="studio-69-logo"
          /></a>
          <div class="navMenu">
            <ul class="navList">
              <a href="#home" class="navLink" onclick="closeMenu();"
                ><li class="navItem">Home</li></a
              >
              <a href="#" class="navLink" onclick="closeMenu();"
                ><li class="navItem">Studio</li></a
              >
              <a href="#" class="navLink" onclick="closeMenu();"
                ><li class="navItem">Projects</li></a
              >
              <a href="#" class="navLink" onclick="closeMenu();"
                ><li class="navItem">Contact</li></a
              >
              <i
                class="bx bx-toggle-left"
                onclick="toggleTheme(); closeMenu();"
              ></i>
              <i class="bx bx-x" onclick="closeMenu();"></i>
            </ul>
          </div>
          <i class="bx bx-menu" onclick="openMenu();"></i>
        </nav>
      </header>

      <!--==================== HOME ====================-->
      <section class="home" id="home">
        <div class="homeHeader">
          <h1 class="homeTitle">STUDIO 69</h1>
          <h3 class="homeSubtitle">Architecture at its Finest</h3>
        </div>
      </section>

      <!--==================== ABOUT ====================-->
      <section class="section container about">
        <div class="aboutHeader">
          <h1 class="aboutTitle">About us</h1>
          <p class="aboutPara">
            Studio 69 Architects is a Bangalore-based architectural practice
            with a strong focus on design. After several years of working with
            some of India’s respected architectural firms, Ganesh Kumar
            established Studio 69 Architects in 1995. Since then, Studio 69 has
            completed a number of successful projects across India-ranging from
            residential, commercial, civic projects as well as interiors. Our
            team are experienced, innovative, and committed to achieving an
            outstanding result for every project. We treat every project with
            great important regardless how small, large, simple, or complex. We
            are determined to ensure that the completed design and built project
            satisfies the client’s needs, objectives an aspirations. The
            founding principle of Studio 69 is to address human needs through
            built form. We design to cater to the requirements of the client by
            curating a functional and aesthetical environment that are
            commercially smart.
          </p>
        </div>
      </section>

      <!--==================== COURSES ====================-->
      <section class="section container"></section>

      <!--==================== TESTMONIALS ====================-->
      <section class="section container"></section>

      <!--==================== CONTACT ====================-->
      <section class="section container"></section>

      <!--==================== FOOTER ====================-->
      <section class="section container"></section>

      <!--=============== SCROLL UP ===============-->
      <a href="#home"><i class="bx bx-chevron-up"></i></a>
    </main>

    <!--=============== MAIN JS ===============-->
    <script src="assets/js/script.js"></script>
  </body>
</html>
/*=============== VARIABLES CSS ===============*/
:root {

  /*========== Colors ==========*/
  --primary-color: #141414;
  --secondary-color: #FFFFFF;
  --accent-color: #0046d2;
  --small-width: 94%;
  --medium-width: 90%;
  --big-width: 76%;

  /*========== Font and typography ==========*/
  --big-font-size: 2rem;
  --h1-font-size: 1.5rem;
  --h2-font-size: 1.25rem;
  --h3-font-size: 1rem;
  --normal-font-size: .938rem;
  --small-font-size: .813rem;
  --smaller-font-size: .75rem;

  /*========== Font weight ==========*/
  --font-regular: 400;
  --font-medium: 500;
  --font-semi-bold: 600;
  --font-bold: 700;
}

/* Responsive typography */
@media screen and (min-width: 968px) {
  :root {
    --big-font-size: 3.5rem;
    --h1-font-size: 2.25rem;
    --h2-font-size: 1.5rem;
    --h3-font-size: 1.25rem;
    --normal-font-size: 1rem;
    --small-font-size: .875rem;
    --smaller-font-size: .813rem;
  }
}

/*=============== BASE ===============*/
* {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--primary-color);
  background: var(--secondary-color);
  font-family: "Poppins", sans-serif;
  transition: .2s;
  z-index: 10000000;
}

body,
button,
input,
textarea,
p {
  font-size: var(--normal-font-size);
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

h1,
h2,
h3 {
  color: var(--title-color);
  font-weight: var(--font-semi-bold);
}

ul {
  list-style: none;
}

a {
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

.bx {
  cursor: pointer;
}

/*=============== THEME ===============*/
body.darkTheme {
  --primary-color: #FFFFFF;
  --secondary-color: #141414;
}

/*=============== REUSABLE CSS CLASSES ===============*/
.section {
  padding: 70px 0px;
  min-height: 100vh;
}

.container {
  margin-left: 1.5rem;
  margin-right: 1.5rem;
}

@media only screen and (max-width: 425px) {
  .container {
    max-width: var(--small-width);
  }
}

@media only screen and (min-width: 768px) {
  .container {
    max-width: var(--medium-width);
  }
}

@media only screen and (min-width: 1024px) {
  .container {
    max-width: var(--big-width);
  }
}

.grid {
  display: grid;
}

.main { 
  overflow: hidden;
  /*For animation*/
}

/*=============== HEADER ===============*/
.header {
  width: 100%;
  padding: 20px 30px;
  position: fixed;
  top: 0;
  left: 0;
  background: transparent;
  transition: .2s;
}

.logo {
  width: 130px;
}

.sticky {
  background: var(--secondary-color);
  padding: 10px 30px;
  box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.26);
  transition: .2s;
}

.header.sticky .navLink {
  color: var(--primary-color);
  transition: .2s;
}

.header.sticky .bx-toggle-left {
  color: var(--primary-color);
}

.header.sticky .bx-toggle-right {
  color: var(--primary-color);
}

.header.sticky .bx-menu {
  color: var(--primary-color);
}

.header.sticky .navLink:hover {
  color: var(--accent-color);
  transition: .2s;
}

/*=============== NAV ===============*/
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navLink {
  color: white;
}

.navList {
  display: flex;
  align-items: center;
  justify-content: space-between;
  column-gap: 50px;
}

.bx-toggle-left {
  color: white;
  font-size: 25px;
}

.bx-toggle-right {
  color: white;
  font-size: 25px;
}

.bx-x, .bx-menu {
  display: none;
}

@media screen and (max-width: 768px) {
  .navList {
    position: absolute;
    top: 0;
    right: -100%;
    width: 80%;
    height: 100vh;
    background: var(--secondary-color);
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    flex-direction: column;
    row-gap: 40px;
    padding: 40px 40px;
    border-top-left-radius: 1rem;
    border-bottom-left-radius: 1rem;
    box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.26);
    transition: .3s ease-in-out;
    z-index: 100;
  }

  .navLink {
    color: var(--primary-color);
    font-size: var(--h2-font-size);
  }

  .bx-toggle-left, .bx-toggle-right {
    color: var(--primary-color);
    position: absolute;
    top: 80px;
    right: 30px;
    font-size: 30px;
  }

  .bx-x {
    display: block;
    position: absolute;
    top: 30px;
    right: 30px;
    font-size: 30px;
  }

  .bx-menu {
    display: block;
    font-size: 30px;
    color: white;
  }
}

/*=============== HOME ===============*/
.home {
  width: 100%;
  height: 100vh;
  background-image: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
    url("../../media/bg.jpg");
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
}

.homeHeader {
  text-align: center;
  color: white;
}

.homeTitle {
  font-size: var(--big-font-size);
}

.homeSubtitle {
  font-size: var(--normal-font-size);
  font-weight: var(--font-medium);
}

/*=============== ABOUT ===============*/
.aboutHeader {
  text-align: center;
}

.aboutTitle {
  font-size: var(--big-font-size);
}

.aboutPara {
  font-size: var(--normal-font-size);
}

/*=============== COURSES ===============*/


/*=============== TESTMONIALS ===============*/


/*=============== FOOTER ===============*/


/*=============== SCROLL BAR ===============*/
::-webkit-scrollbar {
  width: 15px;
  background: #141414;
}

::-webkit-scrollbar-thumb {
  background: #404040;
  border-radius: 1rem;
}

/*=============== TO-TOP ===============*/
.bx-chevron-up {
  position: fixed;
  bottom: 60px;
  right: -200px;
  font-size: 25px;
  padding: 15px;
  border-radius: 50%;
  background: var(--accent-color);
  color: white;
  box-shadow: 0px 0px 9px 1px rgba(0, 0, 0, 0.26);
  transition: .3s ease-in-out;
  font-weight: var(--font-medium);
}

/*=============== RESPONSIVE BREAKPOINTS ===============*/

/* For small devices */
@media screen and (max-width: 320px) {
  .container {
    margin-left: 1rem;
    margin-right: 1rem;
  }
}

@media screen and (max-width: 425px) {
  .header {
    padding: 20px 5px;
  }

  .header.sticky {
    padding: 5px 5px;
  }
}

/* For medium devices */
@media screen and (min-width: 768px) {}

@media screen and (max-width: 768px) {}

/* For large devices */
@media screen and (min-width: 992px) {
  .container {
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (min-width: 1200px) {}
/*=============== CHANGE HEADER BACKGROUND ===============*/
window.addEventListener("scroll", function () {
  const header = document.querySelector("header");
  header.classList.toggle("sticky", window.scrollY > 0);
});

const menu = document.querySelector(".navList");
function openMenu() {
  menu.style.right = "0";
}

function closeMenu() {
  menu.style.right = "-100%";
}

/*=============== SHOW SCROLL UP ===============*/
const toTop = document.querySelector(".bx-chevron-up");
window.addEventListener("scroll", () => {
  if (window.scrollY > 100) {
    toTop.style.right = "30px";
  } else {
    toTop.style.right = "-100px";
  }
});

/*=============== DARK LIGHT THEME ===============*/
const themeToggle = document.querySelector(".bx-toggle-left");
function toggleTheme() {
  document.body.classList.toggle("darkTheme");

  if (document.body.classList.contains("darkTheme")) {
    themeToggle.classList.add("bx-toggle-right");
    themeToggle.classList.remove("bx-toggle-left");
  } else {
    themeToggle.classList.add("bx-toggle-left");
    themeToggle.classList.remove("bx-toggle-right");
  }
}

/*=============== SCROLL REVEAL ANIMATION ===============*/
const sr = ScrollReveal({
  origin: "top",
  distance: "60px",
  duration: "2000",
  // reset: true
});

sr.reveal(".homeTitle, .homeSubtitle", {});

sr.reveal("", {
  interval: 100,
});

sr.reveal(".aboutPara", {
  origin: "left",
});

sr.reveal(".aboutTitle", {
  origin: "right",
});

sr.reveal("", {
  origin: "bottom",
});

“.innerHTML” Not Displaying Correctly On Mobile (JavaScript)

My Problem:

Hey Everyone,

I’m currently trying to write some simple code that takes specific strings and makes them bold using only JavaScript. The code works fine, but when testing it on mobile I noticed that it doesn’t display the newly boldened string correctly.

Instead, it doesn’t display anything.

Can anyone help me out with this?

What I’ve Tried:

I thought that maybe since I was replacing the text using “.innerHTML” rather than “.innerText” it was causing some sort of issue, however, I need to use “.innerHTML” since the string that JavaScript is returning is in HTML formatting (ex. <b>{Insert string here}</b>).

I tried setting the inner text of the elements equal to their inner HTML, but that resulted in each string being displayed as “<b>{Insert string here}</b>” rather than just the bold text alone.

My Code:

var text = document.getElementsByClassName('text-bold')
var boldText = []

for (i = 0; i < text.length; i++) { // For all of the elements with the class "text":
  var str = text[i].innerText // Get the inner text
  var bold = str.bold() // Make the inner text bold
  boldText.push(bold) // Return the string to an array
}

for (i = 0; i < text.length; i++) { // For all of the elements with the class "text":
  text[i].innerHTML = boldText[i] // Replace the inner HTML with the corresponding bold text from the array
}
<div>
  <p class="text-bold">Hello!</p>
  <p class="text">Hi!</p>
  <p class="text-bold">Hey!</p>
</div>

Memory Leak: JavaScript – passing array buffer to Web Worker using transferable object, GC doesn’t kick in

So, I am passing video buffer(Float32Array buffer) to worker thread as a transferable object, it happens for each frame of the video(meaning, continuously video frames are being passed to worker). I did memory profiling, and worker thread is retaining the object, it seems garbage collector doesn’t kick in. How to handle this case? I don’t think one can invoke GC explicitly in JavaScript.

Here is the code snippet how I am passing video buffer to worker thread:

this.worker.postMessage({
          command: 'SetVideoBuffer',
          data: {
            videoFrame: videoFrame
          }
        },
          [videoFrame.buffer]);

Kindly help me with this. Thank you!

Handling errors in java script

I have problem in JavaScript when it comes handling errors. This is the code:

    const [file, setFile] = useState(null);
  const {user} = useContext(Context);

  const handleSubmit = async (e, resp) =>{
    e.preventDefault();
    const newPost = {
      username:user.username,
      title,
      desc,
    };
    if(file){
      const data = new FormData();
      const filename = Date.now() + file.name;
      data.append("name", filename);
      data.append("file",file);
      newPost.photo = filename;
      try{
        await axios.post("/upload",data);
      }catch(err){
        console.log(err);
      }
    }
    try{
    const res = await axios.post("/posts", newPost);
    window.location.replace("/post/"+res.data._id);
    }catch(err){
      console.log(err);
    }
  };

I am pretty sure that mistake comes from handling errors because I am getting this error:
POST http://localhost:3000/posts 500 (Internal Server Error)
When I handled errors correctly I didn’t have this. But now not sure what to write inside catch block so I can get rid of this error.

exists alternative way to debbug in console all elements of an Array Iterator object

exists alternative way to debbug in console all elements of an Array Iterator object , this is the best way I am found :

const fruit_4 = ["Banana", "Apple", "Kiwi", "Mango"];
const fruit_4_entries_2 = fruit_4.entries();

for (let i = 0; i < fruit_4.length; i++) {
    console.log("fruit_4_entries.next() element " + i + " : ", 
    fruit_4_entries_2.next();
}

excluding writing to an html element such as this :

 for (x of fruit_4_entries_2) {
   document.getElementById("id_div_demo"). innerhtml += x + "<br>";
 }

Is there an alternative way for only fruit_4_entries_2 debbug which is Array Iterator object (without using fruit_4)?

For example, a way to debug with console.log (fruit_4_entries_2.next()), without knowing the size or what the fruit_4 array contains

Making a folder with html and node.js

I wanted to make a website that takes an input and, using node.js for the backend, makes a folder using mkdirSync(input.value). I have the fs module installed locally and I got it to work when using javascript only, but when I try to make it from a button on a web page it doesn’t work. This is my folder and file structure:

  • Project folder
    • node_modules
    • src
      • index.html
      • script.js
    • package-lock.json
    • package.json

This is the code in the index.html and script.js files:

const fs = require("fs")
const btn = document.querySelector("#btn")
const input = document.querySelector("#in")
btn.addEventListener("click", () => {
    fs.mkdirSync(`./src/${input.value}`)
})
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> Document </title>
</head>
<body>
    <input type="text" id="in">
    <input type="submit" id="btn">

    <script src="script.js"></script>
</body>
</html>

Is it possible to do this in the first place? I cannot use PHP since I won’t be able to use a server for this project. If you have ANY other ideas please tell me, it might be of help.

How to Remove all instances of text “[” character

In Google Apps Scripts, I’m trying to use a regex expression that can match all occurrences of text that is between “[” and any number of characters “]”, then delete everything including [text_any_length]

So far, this expression only finds one occurrence, but there are multiple. I’m not sure if I need a loop, change the regex expression, or use different methods.

Logger.log(body.findText("\]").getElement().asText().getText() )

How can I fix this error “Maximum number of emoji reached (50)” on discord

So ive been making a command to steal an emoji from a different server, and im just trying to handle errors, but cannot seem to handle this error without it still throwing the error in my console like a madman…

const Discord = require("discord.js")
const config = require("../../botconfig/config.json");
const ee = require("../../botconfig/embed.json");
const settings = require("../../botconfig/settings.json");

module.exports = {
  name: "steal",
  category: "Utility",
  permissions: ["MANAGE_EMOJIS_AND_STICKERS"],
  aliases: ["steal"],
  cooldown: 5,
  usage: "steal <emoji>",
  description: "Add emoji to the server",

  run: async (client, message, args, plusArgs, cmdUser, text, prefix) => {
    if (!message.member.permissions.has("MANAGE_EMOJIS_AND_STICKERS")) return message.channel.send("<a:mark_rejected:975425274487398480> **You are not allowed to use this command. You need `Manage Emoji` permission to use the command.**")
    
if (!args.length) return message.channel.send(`Please give me a emoji to add`);
    for (const emojis of args) {
      const getEmoji = Discord.Util.parseEmoji(emojis);

      if (getEmoji.id) {
        const emojiExt = getEmoji.animated ? ".gif" : ".png";
        const emojiURL = `https://cdn.discordapp.com/emojis/${getEmoji.id + emojiExt}`;
        message.guild.emojis.create(emojiURL, getEmoji.name).then(emoji => message.channel.send(`<a:mark_accept:975425276521644102> Successfully Added : ${emoji} (`${emoji.name}`) to the server`));
      }
    }
  }
}```

tabs in multiple lines of contenteditable div

in the example below pls place cursor at the start of any line and pressTab key
this works fine
I want the same if multiple lines are selected at once and also delete one tab if Shift+Tab is pressed
Probably I need an array of selected lines but have no idea how to get them
Please help

$('#wrap').on('keydown', function(e){
    if(e.keyCode === 9){
        e.preventDefault();
        var range = window.getSelection().getRangeAt(0);
        var tab = document.createTextNode("u00a0");
        range.insertNode(tab);
        range.setStartAfter(tab);
    }
});
.wrap{padding:0 14px 9px 14px; white-space:pre-wrap; background:orange; outline:none;}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class='wrap' id='wrap' contenteditable>
lorem ipsum
dolor sit
amet
</div>

how to add eventlistner to button added by a class which is method of class itself

I am making a module which shows a modal. I added a button on modal to close it and added this.hide as it’s onclick but this does not closes the modal

code:

class Modal {
  constructor(content, allowclose, onclose) {
    this.content = content;
    this.allowclose = allowclose || true;
    this.onclose = onclose;
    // console.log(this.content)
    document.body.innerHTML += `<div id='modal-js-bg'><div id='modal-js-main'><div id='modal-js-content'>${this.content}</div>
<div id='modal-js-close'><button id='modal-js-close-btn' disabled=${!this.allowclose} onclick=${this.hide}>Close</button></div></div></div>`
  }

  show() {
    document.getElementById('modal-js-bg').style.display = 'flex';
    document.getElementById('modal-js-main').style.animation = 'showmodal 325ms ease-in';
  }

  hide() {
    document.getElementById('modal-js-bg').style.display = 'none';
    document.getElementById('modal-js-main').style.animation = 'hidemodal 325ms ease-out';
  }


}
#modal-js-bg{
  width: 100vw;
  height: 100vh;
  position: absolute;
  background-color: rgba(0,0,0,0.6);
  display: none;
  justify-content: center;
  align-items: center;
}
#modal-js-main{
  background-color:white;
  width:50%;
  padding:10px;
  display: flex;
  font-size:18px;
  align-items: center;
  flex-direction:column;
}
#modal-js-close-btn{
  background-color: #2e2eff;
  height:35px;
  width: 80px;
  border-radius: 7px;
  color: white;
  border: none;
}

@keyframes showmodal {
  0%{
    opacity:0;
  }
  100%{
    opacity:1;
  }
}
@keyframes hidemodal {
  0%{
    opacity:1;
  }
  100%{
    opacity:0;
  }
}
<html>
<head>
<title>modal</title>
</head>

<body>
  <script>
    window.onload = function () {
      const mymodal = new Modal('this is example')
      mymodal.show()
      }
  </script>

</body>

</html>

on document tree i can see that onclick function is written but every thing is written in small letters getElementById is written as getelementbyid
I am not able to solve this can anyone help
Thanks in advance

How can I merge array of objects base on common property [duplicate]

I want to merge every student that did the same subject together into an array and I want to return the entire result as an array. Please check the output I comment below for a better understanding

let utme = [
     {subject:'English',    student:'Doe'},
     {subject:'Math',       student:'wale'},
     {subject:'Chemistry',  student:'Bisi'},
     {subject:'Math',       student:'bola'},
     {subject:'Biology',    student:'Raji'},
     {subject:'Chemistry',  student:'John'},
     {subject:'Physics',    student:'Bolu'},
     {subject:'Math',       student:'John'},
]

function merge(arr){
    const hash = {};
   return arr.reduce((accu, curr) => {
      
      hash['subject'] = curr.subject;
      hash['student'] = [].concat(curr.student);
      console.log(hash)
      

   },[])
}

merge(utme)


/*     this is the result I want
   [
     {subject:'English',    student:['Doe']},
     {subject:'Math',       student:['Wale', 'Bola', 'John']},
     {subject:'Chemistry',  student:['Bisi','John']},
     {subject:'Biology',    student:'Raji'},
     {subject:'Physics',    student:['Bolu']}      
]
*/