Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Half or Right Triangle star pattern in JavaScript

// Half or Right Triangle star pattern in JavaScript
let numberValue = 5;
let stringValue = '';
for(let i=1; i<=numberValue; i++){
  for(let j=1; j<= numberValue - i; j++){
    stringValue += ' ';
  }
  for(let k=1; k<=i; k++){
    stringValue += '*';
  }
  stringValue += '
';
}
console.log(stringValue);
Comment

Half or Left Triangle Pattern in JavaScript

// Half or Left Triangle Pattern in JavaScript
let numberleft = 5;
let stringleft = '';
for(let i=1; i<=numberleft; i++){
  for(let j=1; j<=i; j++){
    stringleft += '*';
  }
  for(let k=1; k<= numberleft -i; k++){
    stringleft += ' ';
  }
  stringleft += '
';
}
console.log(stringleft);
Comment

PREVIOUS NEXT
Code Example
Javascript :: new Intl.NumberFormat en react 
Javascript :: safari technology 
Javascript :: Total shopping amount from an object in javascript 
Javascript :: concatenation mathematics notation 
Javascript :: store string in array javascript 
Javascript :: react-router-dom status code 301 
Javascript :: flyweight 
Javascript :: NGX loading Interceptor 
Javascript :: Dynamically Generated Table 
Javascript :: tabindex 
Javascript :: js what does the vertical line symbol do 
Javascript :: a to z in js using while 
Javascript :: focus on child components on single page applications - 2 
Javascript :: javascript how to multiply numbers 
Javascript :: how to Initialize and fill an array with the specified values in javascript 
Javascript :: multiple comparison javascript 
Javascript :: .localecompare number func 
Javascript :: filewatcher nodejs 
Javascript :: javascript array negative index 
Javascript :: reactRender 
Javascript :: server starter code in js 
Javascript :: how to call url multiple times 
Javascript :: parentsuntil without jquery 
Javascript :: gitignore jsconfig 
Javascript :: complicated reduce 
Javascript :: convert typescript to js online 
Javascript :: Private slots are new and can be created via Static initialisation blocks in classes 
Javascript :: nodejs post req accept form data 
Javascript :: npm resize div 
Javascript :: multiplicar celulas js 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =