<commit_before>// block scope - let
// To do: make all tests pass, leave the asserts unchanged!

describe('`let` restricts the scope of the variable to the current block', () => {

  describe('`let` vs. `var`', () => {

    it('`var` works as usual', () => {
      if (true) {
        var varX = true;
      }
      assert.equal(varX, true);
    });
    
    it('`let` restricts scope to inside the block', () => {
      if(true) {
        let letX = true;
      }
      assert.throws(() => console.log(letX));
    });
    
  });
  
  it('`let` use in `for` loops', () => {
    let obj = {x: 1};
    for (let key in obj) {}
    assert.throws(() => console.log(key));
  });
  
  it('create artifical scope, using curly braces', () => {
    {
      let letX = true;
    }
    assert.throws(() => console.log(letX));
  });
  
});<commit_msg>Make it nicer and break it, to be a kata :).<commit_after>// block scope - let
// To do: make all tests pass, leave the asserts unchanged!

describe('`let` restricts the scope of the variable to the current block', () => {

  describe('`let` vs. `var`', () => {

    it('`var` works as usual', () => {
      if (true) {
        let varX = true;
      }
      assert.equal(varX, true);
    });
    
    it('`let` restricts scope to inside the block', () => {
      if (true) {
        var letX = true;
      }
      assert.throws(() => console.log(letX));
    });
    
  });

  describe('`let` usage', () => {
    
    it('`let` use in `for` loops', () => {
      let obj = {x: 1};
      for (var key in obj) {}
      assert.throws(() => console.log(key));
    });
    
    it('create artifical scope, using curly braces', () => {
      {
        var letX = true;
      }
      assert.throws(() => console.log(letX));
    });
    
  });
  
});
{'fraction_non_alphanumeric': 0.19213483146067414, 'fraction_numerical': 0.0011235955056179776, 'mean_word_length': 2.0654044750430294, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2351756', 'n_tokens_mistral': 611, 'n_tokens_neox': 590, 'n_words': 171}