ABOUT ME

어제보다 성장한 오늘, 이전보다 더 나아진 세상을 지향하는 개발자의 블로그 입니다.

Today
Yesterday
Total
  • Import Named Imports
    Study/JavaScript 2020. 5. 14. 19:19

    Import Named Imports

    To import variables that are declared, we simply use the original syntax that describes the variable name. In other words, exporting upon declaration does not have an impact on how we import the variables.

     

     

    import { specialty, isVegetarian } from 'menu';

    import {availableAirplanes, flightRequirements, meetsStaffRequirements,meetsSpeedRangeRequirements} from './airplane';
    
    function displayFuelCapacity() {
      availableAirplanes.forEach(function(element){
      console.log('Fuel Capacity of ' + element.name + ': ' + element.fuelCapacity);
      });
    }
    
    displayFuelCapacity();
    
    function displayStaffStatus() {
      availableAirplanes.forEach(function(element) {
       console.log(element.name + ' meets staff requirements: ' + meetsStaffRequirements(element.availableStaff, flightRequirements.requiredStaff) );
      });
    }
    
    displayStaffStatus();
    
    function displaySpeedRangeStatus() {
      availableAirplanes.forEach(function(element) {
       console.log(element.name + ' meets speed range requirements: ' + meetsSpeedRangeRequirements(element.maxSpeed, element.minSpeed, flightRequirements.requiredSpeedRange));
      });
    }
    
    displaySpeedRangeStatus();

    'Study > JavaScript' 카테고리의 다른 글

    Import as  (0) 2020.05.14
    Export as  (0) 2020.05.14
    Export Named Exports  (0) 2020.05.14
    Named Exports  (0) 2020.05.14
    import  (0) 2020.05.14

    댓글

Designed by Tistory.