-

   rss_rss_hh_full

 - e-mail

 

 -

 LiveInternet.ru:
: 17.03.2011
:
:
: 1

:


JavaScript, ,

, 24 2017 . 16:25 +
VladVR 16:25

JavaScript, ,

    Javascript. , , , , , .
    .

    , , Javascript . , -, . , , . :

    let a = {
      'myKey': 'myValue'
    }
    let key = 'constructor'; // comes from outside source
    let b = a[key] || 'defaultValue';
    expect(b).to.be.equal('defaultValue'); // fails
    

    , , , , , , .

    , , , . , , , . , , , , . , , , , . , , , , . , . , .

    hash-map :

      const result = {};
      for (var prop of Object.getOwnPropertyNames(Object.prototype)) {
        result[prop] = undefined;
      }
      return result;
    

    readme.

    Yet another JS library


    , . typescript-reexport-generator. typescript - , , . .ts :

    // file1
    export function myFunction(){}
    
    // file2
    export class myClass{}
    

    index.ts :

    export * from './file1';
    export * from './file2';
    

    :

    //
    import { myFunction } from './folder/file1';
    import { myClass } from './folder/file2';
    //
    import { myFunction, myClass } from './folder';
    

    , :

    import { myClass } from '.';
    export function myFunction(){ // doSmth with class }
    

    -: VSCode (ctrl + mouse click) . 1 . default , , .

    , , , index.ts gulp.watch. -, .

    , , , VSCode , . index, , . , gulp.watch , ( ) . . , , .
    Original source: habrahabr.ru (comments, light).

    https://habrahabr.ru/post/338594/

    :  

    : [1] []
     

    :
    : 

    : ( )

    :

      URL