Square Star Pattern in Javascript Demo | Stackblitz

CODE:


// Import stylesheets
let n = 5// row or column count
// defining an empty string
let string = "";

for(let i = 0i < ni++) { // external loop
  for(let j = 0j < nj++) { // internal loop
    string += "*";
  }
  // newline after each row
  string += "\n";
}
// printing the string
console.log(string);


DEMO


   


Square Star Pattern in Javascript  Demo




No comments:

Post a Comment

JavaScript + Angular-compatible version of loan amortization calculator that you can integrate into an Angular component or service

  JavaScript Version of Loan Amortization 1. Loan Calculator Function (Pure JS/TS) export function calculateLoanSchedule ( principal:...

Best for you