Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

import js file into another

export function greet(name) {
  return `Hello, ${name}`;
}

export const message = "How you doing?";

///

import { greet, message } from "./utils.js";

const greet_scaler = greet("Scaler");

console.log(greet_scaler); // Hello, Scaler
console.log(message); // How you doing?
Source by www.scaler.com #
 
PREVIOUS NEXT
Tagged: #import #js #file
ADD COMMENT
Topic
Name
5+8 =