EN
Dirask - write better posts - quick solution / code examples - simple variable input data
3
points
Very good data examples for quick solutions and code examples:
// ONLINE-RUNNER:browser;
var text = 'abc'; // small letters recommended
var text = 'ABC';
var number = 123;
var text = 'abcde'; // when required to work on longer strings
var text = 'ABCDE';
Why we need to use simple variable values?
It is very easy to undestand the post if variable values are simple and very commonly used accorss all posts.
Also if human eye and brain can process example quicker than user experience is better, because user can quicker find solution.
Posts examples with correctly used short variable values:
Wrong:
var text = 'This is my text...';
// or
var text = 'This is some very long text, This is some very long text, This is some very long text';
If example doesn't require long and complex variable value, then use simple variables, like showed above.
Why long and complex variable value are wrong?
It is harder to understand the qucik solution / code example when variables value is long.