xxxxxxxxxx
const devideSubStr = (str) => {
var totalLoop = str.length * ((str.length + 1)/2);
// looping count
let i = 0;
var totalChar = 1;//character to get
var charFrom = 0;// from which index
var strLength = str.length;//length of digit
while( i < totalLoop){
console.log(str.substr(charFrom, totalChar))
charFrom ++;
i ++;
if(charFrom == strLength){
charFrom = 0;
strLength = strLength - 1;
totalChar ++;
}
}}