News for hackers. Stuff that matters.
Re:Show HN: A JavaScript String replace API that challenges ... by wildpeaks on Sunday August 28, 2016 @06:47PM (#12378903)
Destructuring assignment could also helps readability, for example:

  function replace(text, {fromText = '', toText = '', caseInsensitive = false} = {}){
  	//
  	// ...
  	//
  }

  replace(
  	'Get on the Road',
  	{
  		fromText: 'road',
  		toText: 'bus',
  		caseInsensitive: true
  	}
  );

There are no comments on this comment yet.