Using the following classes:
.dyCodeHighlighter
.line-numbers
Using the following attributes:
data-dyCodeHighlighter-highlight="11,20,22"
data-dyCodeHighlighter-header='{"lines": "show", "filename": "app.js"}'
/**
* This is a sample program to print the following pattern.
*
* H
* Ha
* Hap
* Happ
* Happy
*/
var
str = "Happy",
len = str.length,
r,
c,
pattern;
for (r = 0; r < len; r++) {
pattern = '';
for (c = 0; c <= r; c++) {
pattern += str[c];
}
console.log(pattern);
}