Answers for "write pattern in js"

1

how to print diamond pattern in javascript

<script type="text/javascript">


    for(var i=1;i<=5;i++)
        {
            for(var j=1;j<=i;j++)
                {
                    console.log("*");
                    
                }
            console.log("\n");
        }



</script>
Posted by: Guest on September-03-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language