Demo - Custom Style

custom style JSON format

{
  "backgroundColor": "#7b68ee",          //optional, value in valid color name, hex, rgb, rgba
  "color": "white",                      //optional, value in valid color name, hex, rgb, rgba
  "highlightBgColor": "white",           //optional, value in valid color name, hex, rgb, rgba
  "highlightColor": "black",             //optional, value in valid color name, hex, rgb, rgba
  "border": "5px solid blue",            //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
  "borderTop": "5px solid blue",         //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
  "borderRight": "4px dashed #aaa",      //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
  "borderBottom": "5px solid blue",      //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
  "borderLeft": "4px dashed #aaa",       //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
  "lineNumbersBorder": "5px solid #fff", //optional, value in valid form 'width style color' like '5px solid #aaa' or 'none'
  "fontSize": "24px"                     //optional, value in valid font size unit like: 20px
}

Using the following classes:

Using the following attributes:

/**
 * 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);
}

Demo - Custom Style 2

Using the following classes:

Using the following attributes:

/**
 * 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);
}