how to convert this C# code snippet to Javascript -


this question has answer here:

i need understand how javascript handles new string object in c# code below

var upperbound = 14; (int = 0; < upperbound; i++) {     console.writeline(new string('*', i));   } console.readline(); 

this how did in javascript:

var upperbound = 14;  for(var i=0;i<upperbound;i++){    console.log(new string("*", i));  }

am newbie in programming , started off javascript if appear dumb asking question pls pardon , assist me explaining.. thanks

there no equivalent new string("*", i) in js. need repetition yourself.

a handy hack array(i + 1).join("*"), not efficient don't think, needs construct array. best way loop , concatenate.


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -