50 shades of JavaScript: 50 of the most interesting features, concepts, and patterns in JavaScript. by Krasimir Tsonev
Author:Krasimir Tsonev [Tsonev, Krasimir]
Language: eng
Format: azw3, epub, pdf
Published: 2021-11-27T00:00:00+00:00
const arr = ['BE:Node', 'BE:PHP', 'FE:HTML', 'BE:Python', 'FE:CSS']; const arrFiltered = arr.filter(i => i.startsWith('FE:')); function getText(items) { const str = `Front-end: ${items.map(i => i.replace(/^FE:/, '')).join(', ')}` return str; } getText(arrFiltered); // Front-end: HTML, CSS
This code is not bad but what if we change the naming a bit:
const languages = ['BE:Node', 'BE:PHP', 'FE:HTML', 'BE:Python', 'FE:CSS']; const FELanguages = languages.filter(lang => lang.startsWith('FE:')); function formatLanguagesText(languages) { const str = `Front-end: ${ languages.map(lang => lang.replace(/^FE:/, '')).join(', ') }` return str; } formatLanguagesText(FELanguages); // Front-end: HTML, CSS
arr and arrFiltered constants are just too generic and will quickly lose meaning. getText function is indeed about generating a string, but again it doesnât bring enough context. So, languages, FELanguages and formatLanguagesText are a bit longer but give a better idea of what we mean with this code.
Download
50 shades of JavaScript: 50 of the most interesting features, concepts, and patterns in JavaScript. by Krasimir Tsonev.epub
50 shades of JavaScript: 50 of the most interesting features, concepts, and patterns in JavaScript. by Krasimir Tsonev.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Exploring Deepfakes by Bryan Lyon and Matt Tora(7337)
Robo-Advisor with Python by Aki Ranin(7238)
Offensive Shellcode from Scratch by Rishalin Pillay(5910)
Ego Is the Enemy by Ryan Holiday(4882)
Microsoft 365 and SharePoint Online Cookbook by Gaurav Mahajan Sudeep Ghatak Nate Chamberlain Scott Brewster(4618)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4412)
Python for ArcGIS Pro by Silas Toms Bill Parker(3984)
Elevating React Web Development with Gatsby by Samuel Larsen-Disney(3686)
Machine Learning at Scale with H2O by Gregory Keys | David Whiting(3399)
Learning C# by Developing Games with Unity 2021 by Harrison Ferrone(3251)
Speed Up Your Python with Rust by Maxwell Flitton(3210)
Liar's Poker by Michael Lewis(3191)
OPNsense Beginner to Professional by Julio Cesar Bueno de Camargo(3177)
Extreme DAX by Michiel Rozema & Henk Vlootman(3154)
Agile Security Operations by Hinne Hettema(3107)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic and Jasmin Redzepagic(3096)
Essential Cryptography for JavaScript Developers by Alessandro Segala(3067)
Cryptography Algorithms by Massimo Bertaccini(2983)
AI-Powered Commerce by Andy Pandharikar & Frederik Bussler(2968)
