Let's say I have a file called app.js. Pretty simple:  var express = require('express'); var app = express.createServer(); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.get(&#...
I was reading the es6 import statement reference on MDN. The syntax:  import "my-module";   will import an entire module for side effects only, without importing any bindings. I am not sure what side effects mean. I have been using with angul...
I have a question about including a file in javascript.  I have a very simple example:   --> index.html --> models       --> course.js       --> student.js   course.js:  function Course() {     this.id = '';     this.name = '&...
I've been setting up an import script for plain-text files in a web application.  My script is as follows:  function dataImport(files) {     confirm("Are you sure you want to import the selected file? This will overwrite any data that is curr...
I am currently working on an application that handles a fairly large amount of data. Currently, I've hard-coded those values into the Javascript iself (defining global arrays), but this method does not seem sustainable.  Is there a way to use Jav...
I'm using ES6 modules and am importing a variable from moduleA into moduleB:  //moduleA.js let a = 5; let b;  export { a, b };  //moduleB.js import { a, b } from './moduleA'  a = 6; b = 1;   But on change/assignment in moduleB I'm get...
I am writing a simple program that uses a object full of dictionary words. I want to import that object from a different file as it is very large. When trying to import it I get an error that looks like Node.js doesn't know what it is.  I have al...
i have an index.js file that reads:  import aReducer from './ducks/a'; import bReducer from './ducks/b'; import * as aSelectors from './ducks/a'; import * as bSelectors from './ducks/b';  console.log(aReducer) //functi...
I am refactoring my javascript code to make it more object-oriented, but I cannot get the newest features applying classes to work!   First, I declare the class in a separate file as follows:   // models/player.js  export default class Player {     c...
I'm trying to do something like the following, however it returns null:  import { Button as styledButton } from 'component-library'   then attempting to render it as:  import React, { PropTypes } from "react"; import cx from '...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.