mtbink.com logo

Shorten anonymous function

Input (String)
Output (String)

The function of this online utility is to shorten anonymous function.

For example,

describe("mtbinkdotcom_trim()", function(){
  
  let s_inputs = [
  " trim ",
  "  every  ",
  "   line   ",
  ];
  
  it(s_inputs[0], function() {
    assert.equal( mtbinkdotcom_trim(s_inputs[0]), "trim" );
  });
  it(s_inputs[1], function (){
    assert.equal( mtbinkdotcom_trim(s_inputs[1]), "every" );
  });
  it(s_inputs[2], function () {
    assert.equal( mtbinkdotcom_trim(s_inputs[2]), "line" );
  });

});
will becomes:
describe("mtbinkdotcom_trim()", ()=>{
  
  let s_inputs = [
  " trim ",
  "  every  ",
  "   line   ",
  ];
  
  it(s_inputs[0], ()=>{
    assert.equal( mtbinkdotcom_trim(s_inputs[0]), "trim" );
  });
  it(s_inputs[1], ()=>{
    assert.equal( mtbinkdotcom_trim(s_inputs[1]), "every" );
  });
  it(s_inputs[2], ()=>{
    assert.equal( mtbinkdotcom_trim(s_inputs[2]), "line" );
  });

});

Search:

Share:



Flag Counter
RSS