<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fizzBuzz in js &#8211; Learn PHP online</title>
	<atom:link href="https://www.learnphponline.in/tag/fizzbuzz-in-js/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.learnphponline.in</link>
	<description>The Best Free Tutorials of Programming Languages in 2019</description>
	<lastBuildDate>Thu, 21 Jan 2021 14:44:28 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.6.3</generator>
	<item>
		<title>How to create FizzBuzz in Javascript</title>
		<link>https://www.learnphponline.in/create-fizzbuzz-javascript/</link>
					<comments>https://www.learnphponline.in/create-fizzbuzz-javascript/#comments</comments>
		
		<dc:creator><![CDATA[Learn PHP online]]></dc:creator>
		<pubDate>Fri, 01 Jan 2021 10:16:55 +0000</pubDate>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[fizzBuzz]]></category>
		<category><![CDATA[fizzBuzz in js]]></category>
		<guid isPermaLink="false">https://www.learnphponline.in/?p=2819</guid>

					<description><![CDATA[<p>FizzBuzz in js is a basic program to make the beginners better understanding of their own code. using this you can learn how the code actually works. here are two methods in javascript to create FizzBuzz. Using the Function using for Loop Q: Write a program that uses console.log to print all the numbers...</p>
<p>The post <a rel="nofollow" href="https://www.learnphponline.in/create-fizzbuzz-javascript/">How to create FizzBuzz in Javascript</a> appeared first on <a rel="nofollow" href="https://www.learnphponline.in">Learn PHP online</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p><strong>FizzBuzz in js </strong>is a basic program to make the beginners better understanding of their own code. using this you can learn how the code actually works. here are two methods in javascript to create FizzBuzz.</p>
<ol>
<li>Using the Function</li>
<li>using for Loop</li>
</ol>
<p><span style="color: #ff6600;">Q: Write a program that uses console.log to print all the numbers from 1 </span><span style="color: #ff6600;">to 100,  </span><br />
<span style="color: #ff6600;">with two exceptions. For numbers divisible by 3, print &#8220;Fizz&#8221; </span><span style="color: #ff6600;">instead of the number, </span><br />
<span style="color: #ff6600;">and for numbers divisible by 5 (and not 3), print </span><span style="color: #ff6600;">&#8220;Buzz&#8221; instead.</span><br />
<span style="color: #ff6600;">When you have that working, modify your program to print &#8220;FizzBuzz&#8221;,</span><br />
<span style="color: #ff6600;"> </span><span style="color: #ff6600;">for numbers that are divisible by both 3 and 5 (and still print &#8220;Fizz&#8221; or </span><span style="color: #ff6600;">&#8220;Buzz&#8221; for numbers divisible by only one of those).</span><br />
<span style="color: #ff6600;"> </span><span style="color: #ff6600;">(This is actually an interview question that has been claimed to weed </span><span style="color: #ff6600;">out a significant percentage of programmer candidates. So if you solved </span><span style="color: #ff6600;">it, you’re now allowed to feel good about yourself.)</span></p>
<h5>Let&#8217;s starting writing the code here &#8221; How to create FizzBuzz in js&#8221; using Function</h5>
<p>using the function method is best way here we can set the time interval between first step and second step. and I think you can easily understand the code and use it for yourself.</p>
<pre>&lt;script&gt;
var a,b,c;  <span style="color: #008000;">// intialize three variables</span>
a=0;
b=0;
c=0;

function demo(){
a++;

if( a % 15 == 0 )
{
b='fizzBuzz';
document.write(b + "&lt;br&gt;");
}
else if( a % 3 == 0 )
{
b='fizz';
document.write(b + "&lt;br&gt;");
}
else if( a%5==0 )
{
c='Buzz';
document.write(c + "&lt;br&gt;");
}
else{
document.write(a +"&lt;br&gt;");
}

<span style="color: #008000;">// stop set interval after 100</span>

if(a==100)
{
clearInterval(start);
}

}

<span style="color: #008000;">// setInterval repeat calling any function infinite times</span>
var start =setInterval(demo,500);
&lt;/script&gt;
</pre>
<h5>2.Now the Second method  &#8221; How to create FizzBuzz in js&#8221; using For Loop</h5>
<pre>&lt;script&gt;

for (var i=1; i &lt;= 100; i++)
{
 if (i % 15 == 0)
 document.write("FizzBuzz" + "&lt;br&gt;");
 else if (i % 3 == 0)
 document.write("Fizz" + "&lt;br&gt;");
 else if (i % 5 == 0)
 document.write("Buzz" + "&lt;br&gt;");
 else
 document.write(i +"&lt;br&gt;");
}

&lt;/script&gt;</pre>
<p><strong>Summary</strong></p>
<blockquote><p>&#8220;How to create FizzBuzz in js&#8221;: Now you knows the program works in many ways and  its totally depends on programmer. FizzBuzz is the best way to understand conditions.</p>
<p><strong>If You like this article Please Share it&#8230;</strong></p></blockquote>
<p><strong>Read More: </strong><a href="https://www.learnphponline.in/top-10-programming-languages/">which language is best for Future</a></p>
<div class="pvc_clear"></div>
<p id="pvc_stats_2819" class="pvc_stats all  " data-element-id="2819" style=""><i class="pvc-stats-icon medium" aria-hidden="true"><svg aria-hidden="true" focusable="false" data-prefix="far" data-icon="chart-bar" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" class="svg-inline--fa fa-chart-bar fa-w-16 fa-2x"><path fill="currentColor" d="M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z" class=""></path></svg></i> <img decoding="async" width="16" height="16" alt="Loading" src="https://www.learnphponline.in/wp-content/plugins/page-views-count/ajax-loader-2x.gif" border=0 /></p>
<div class="pvc_clear"></div>
<p>The post <a rel="nofollow" href="https://www.learnphponline.in/create-fizzbuzz-javascript/">How to create FizzBuzz in Javascript</a> appeared first on <a rel="nofollow" href="https://www.learnphponline.in">Learn PHP online</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.learnphponline.in/create-fizzbuzz-javascript/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
