New javascript features overview. Part three

Home » Tutorials » JavaScript » New javascript features overview. Part three
In last part of new javascript features lessons we will talk about modules.
Modules let us to create more structured code. It’s important to understand, modules can be exported and imported. Keywords export and import use for it.
Code lesson
<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">

    <!-- <script src="class.js"></script> -->

    <script type="module">
        // import {sayHi, Programmer, cities} from './class.js';
        import * as myModule from './class.js';
        let kam = new myModule.Programmer();

Code lesson
'use strict'
export class Programmer {
    name = 'Камиль';
    lang = 'javascript';

    constructor(age) {
        this.age = age;

    sayHi() {
        console.log(`${}, привет`);

export const cities = [

export function sayHi() {


Submit a Comment

Your email address will not be published. Required fields are marked *

Подписаться на рассылку

Будьте в курсе - получайте последние статьи на свой email

Ваша подписка успешно оформлена

Pin It on Pinterest

Share This