79338949

Date: 2025-01-08 11:32:11
Score: 0.5
Natty:
Report link

when you use the {objectname} syntax on a library it means that you are calling a specific module of that library in this case 'object', example:

example.js function:

export const hello = () => {
  console.log("hello");
};

export const hello_world = () => {
  console.log("hello world");
};

use example.js

import { hello } from "./example.js";

hello();

in this case we can use only function hello()

to be able to use hello_world() as well

import { hello,hello_world } from "./example.js";

hello();
hello_wolrd();

if you need more clarification or something is not clear do not hesitate to ask

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): when you use the
  • Low reputation (1):
Posted by: nome