for (let i = 1; i <= 100; i++) {
let out="";
if (i % 3 === 0) out += 'Fizz';
if (i % 5 === 0) out += 'Buzz';
console.log(out || i);
}
More Related Contents:
- Find out how many tabs are opened in IE [closed]
- Create a Date with a set timezone without using a string representation
- CORS Error: “requests are only supported for protocol schemes: http…” etc
- Script tag in JavaScript string [duplicate]
- What is the difference between the mouseover and mouseenter events?
- React Context vs React Redux, when should I use each one? [closed]
- MediaStream Capture Canvas and Audio Simultaneously
- add commas to a number in jQuery
- React Function Components with hooks vs Class Components
- Is there a template engine for Node.js? [closed]
- HTML table with fixed headers and a fixed column? [closed]
- Can I execute a function after setState is finished updating?
- How to use Cors anywhere to reverse proxy and add CORS headers
- How to prevent default on form submit?
- HTML Drag And Drop On Mobile Devices
- Event when input value is changed by JavaScript?
- JavaScript object destructuring and aliasing
- Alternative version for Object.values()
- Hide all elements with class using plain Javascript
- ES6 promise execution order for returned values
- Why jQuery cannot trigger native click on an anchor tag?
- How to use mixins properly in Javascript
- Why Is `Export Default Const` invalid?
- Regex exec only returning first match [duplicate]
- Discord.js: Invalid bitfield flag or number: GUILDS
- Mock inner axios.create()
- Service Worker Registration Failed
- JavaScript multithreading
- Convert long number into abbreviated string in JavaScript, with a special shortness requirement
- Explain ExtJS 4 event handling