JavaScript Tips @javascript_tips
Tips and tricks to make the most of JavaScript and avoid gotchas. San Francisco, CA Joined May 2016-
Tweets37
-
Followers347
-
Following336
-
Likes199
Arrow functions are not yet supported in Safari, IE and Opera Mini. #javascript #es6 #tip caniuse.com/#feat=arrow-fu…
// ES5 var posNums = nums.filter(function (x) { return x > 0; }); // #ES6 var posNums = nums.filter(x => x > 0); #javascript #tip
#ES6 arrow functions do not have their own 'this'. The value of this inside an arrow function is always inherited from the enclosing scope.
Code is temporary. It exists while it is useful. If code is replaced by better code, good! If code can be deleted, celebrate! #JavaScript
Shorthand for #es6 arrow function with single argument: var f = x => { return x*x; }; // equivalent to var f = (x) => { return x*x; };
Shorthand for #es6 arrow function with single return statement: var f = (x) => x*x; // equivalent to var f = (x) => { return x*x; };
ES6 arrow functions: var normalFunc = function(x) { return x * x; }; var arrowFunc = (x) => { return x*x; }; #javascript #tips
#javascript 'new' keyword: function A() { this.x = 1; this.y = 2; } var a1 = new A(); var a2 = new A(); a1.x++; a1.x; // 2 a2.x; // 1
Usage of the 'arguments' local variable: function foo() { console.log(arguments); } foo(1, 2, 3, 4); // [1, 2, 3, 4] #javascript #tip
Use #es6 in your javascript code today with @babeljs! hacks.mozilla.org/2015/06/es6-in…
Convert CSV to array: var str = "apple, peach, orange"; var fruitsArray = str.split(","); // ['apple', 'peach', 'orange'] #javascript #tip
#JavaScript array to csv: var fruits = ['apple', 'peaches', 'oranges']; var str = fruits.valueOf(); // apple,peaches,oranges #js #tips
Remove duplicates from array: var deduped = [ 1, 1, 'a', 'a'].filter(function (x, i, arr) { return arr.indexOf(x) === i; }); // [1, 'a']
Flattening an array : var myArray = [[1, 2], [], [3]]; var flatArray = [].concat.apply([], myArray); // flatArray is [1, 2, 3] #javascript
Getting a UNIX timestamp in #JavaScript: var dateTime = Date.now(); var timestamp = Math.floor(dateTime / 1000); #tips #js
To see a function's code, concatenate it with the empty string : console.log(funcVariable + ''); #javascript #tips
The && operator first evaluates the expression on the left. If falsy, false is returned; it does not bother to evaluate the right operand.
JavaScript Falsy Values: null, false, 0 undefined, NaN, and “” (this last item is an empty string). #javascript #tips
Infinity, which is a special number like NaN, is truthy; it is not falsy, while NaN is falsy. #javascript #tips
Calculate max/min in an array: var arr = [1, 2, 3, 4]; Math.max.apply(null, arr) // 4 Math.min.apply(null, arr) // 1 #javascript #tips

Timothy Pererat @Dev_Rexzy
52 Followers 564 Following Frontend Developer | UI/UX Designer | JavaScript Enthusiast | Turning ideas into seamless, interactive digital experiences.
EricaKeynes @54773qE59mQ57g
101 Followers 2K Following
Rakibul Islam @0rakibulislam7
8 Followers 287 Following Who am I?🫥 still perusing, won't finale until eternal sleep - ☪️ X 🇧🇩 🎂: Jan 3 | 🩸: B+
Saurav Singh @SauravDVGaur
134 Followers 202 Following Proud Indian 🇮🇳 | Software Engineer | Passionate about Angular & React | Building softwares to make a better world 🌍 Tweet about science, tech. & politics
Morees lijitha @Moreeslijitha
0 Followers 145 Following
kaiden @Natsujmgl_bp
2 Followers 95 Following
Hasan Kuray @kuray_h
2 Followers 62 Following
Milad. Ebrahimi @milad_ebra97958
0 Followers 68 Following
Deepak Kumar @Deepak_Coder
0 Followers 31 Following
Dagmawit Tenaye | ዳ... @DagmawitTenaye
100 Followers 984 Following Professional Civil Engineer ++ I love to code because it is usable art and it is fun ...! --Python and JavaScript--
Chikysabinar @xiky_sabinar
160 Followers 240 Following Intento de estudiante de turismo, con un futuro muy prometedor en la cola del INEM...
yair @Yair_garciaMak
18 Followers 128 Following
Elodie Longo @elodielongo
557 Followers 3K Following Communication, content production, art direction & branding. Working @FAO & @FAOclimate for sustainable food & agriculture for all.
Kowalsaki @kowalsakidev
1 Followers 58 Following
Joseph Aralu @joseph_aralu
2 Followers 10 Following
Min Rai @MinRai24576
1 Followers 52 Following
tamer @tamer10866387
9 Followers 159 Following
Fernando Santos @f3rn4ndoluiz
5 Followers 238 Following
Alis @elvagonperdido
948 Followers 5K Following De Iztapalapa para el mundo. La primera en su nombre, madre de gatos, reina de los solteros, insomne, despeinada, astigmata y chillona.
Rafael Orion @rafaelorion
322 Followers 2K Following 🌱 Vegetariano 💻 Programador 🥋Jiu-Jitsu brown belt 👊🏻 Muay thai vermelho ponta azul ✈️ viagens 🏃🏻♂️ Corridas 📍São Paulo - SP #ForaBolsonaro #Paz
Robo_tech @Robotic258
323 Followers 573 Following Die hard arsenal fan!!!, nature lover, fun, graphics design, website and app developer code, code, code!!!!,
S TUJLIMAN @STujliman
1 Followers 31 Following
Thi A @Thi_a24
0 Followers 25 Following
Rapha @raphael_arantes
231 Followers 1K Following No resumo fé e cultura pop... 💻 Web dev | 🕹️ Games | 🎵 Music | 📷 raphamarates | ❤️ Ma
MotitaSugoi @MotitaSugoi
8 Followers 98 Following
D @devaccount_ts
2 Followers 82 Following
Trọng Phạm @Trng28425226
1 Followers 31 Following
Guillem Rivas Martore... @guillemrima
1 Followers 9 Following ◽ Programador/desarrollador Web Junior. ◽ Administración de sistemas informáticos en red. "Autodidacta, con mucha devoción por la programación"
Sang Pda @AoBotv
0 Followers 3 Following
Andrej Batarilo @BatariloAndrej
2 Followers 17 Following
nama @GoyAhraf
1 Followers 39 Following
Leandro @FenderLeandro
2 Followers 35 Following
Janani Tamilarasan @JananiTamilara5
1 Followers 83 Following
Trang Thai @TrangThai93
1 Followers 58 Following
kishore naidu @kishore54649002
8 Followers 276 Following
Cerosh @Cerosh1
7 Followers 75 Following Opportunity often comes disguised in the form of misfortune, or temporary defeat.
krish_na_ditya @krishnaditya65
3 Followers 284 Following
Market Village @marketstuff1
347 Followers 5K Following The Space of Economic Outlook and trending Business information.
Molly @himollyofficial
696 Followers 4K Following A comprehensive solution for workplace/organizational network communication/collaboration, project management, human resources management, payroll, etc.
Kendi Dalgasında @moronist34
134 Followers 635 Following
Marian Dan Alexandru @marian_dan
21 Followers 189 Following
l Anderson @foffyou3
161 Followers 3K Following
Ramon van Raaij @ramonvraaij
3 Followers 85 Following
raheelshahzad @raheel107047
8 Followers 100 Following
Luco Lesinski @LucoLesinski
14 Followers 472 Following
Ron Ron @Ronnaba
96 Followers 2K Following
Schalavadi @schalavadi2006
9 Followers 2K Following
Daniel @diplopito
506 Followers 3K Following Escritor de relatos con poemas camuflados (que sólo @AliciaAdam16 sabe descamuflar).
Alex Ramirez @alex_reamirez
208 Followers 235 Following Words at Complex, Consequence of Sound, The Current, and Austin Chronicle [email protected]
Hector Montesinos @_montesinos
64 Followers 180 Following Full Stack Web Developer. Ionic Framework + CakePHP
Sarah Hudson @SarahHudson2008
181 Followers 196 Following Sr UI Dev @ Cardinal Solutions; music writer, TTS alumni. Bird lover, designer, dancer, and vegetarian.
Mubashar Ehsan @mub_e
257 Followers 208 Following Engineer | Entrepreneur |Co-Founder & CTO https://t.co/66hoQkH2Hy | techstars alumini| System Architect RT's≠endorsement!!
zangbianxuegu @zangbianxuegu
82 Followers 405 Following Frontend Develop, Husband & Father, Nichiren Buddhism
StrapMobile @StrapMobile
278 Followers 30 Following We offer #ReactNative #Flutter #VueNative mobile app themes, templates, backend products for quick development.
alex hudici @AlexHudici
134 Followers 1K Following
Mandar N Muchandi @MuchandiMandar
543 Followers 4K Following Senior Software Developer (#BigData#Cloud#Office365#Agile#Scrum) Knowledge is Power.
Sylvie Guimont @YourFriendSG
311 Followers 4K Following
George Sgouros @g_sgouros
53 Followers 446 Following
Kelli Waiss @KelliWaiss
59 Followers 168 Following Program Manager | Hiker | Dog lover | Seattle sports fan | World traveler
Ronald Diemicke @RonaldDiemicke
245 Followers 1K Following Family, work, games, movies. In that order. (He/Him) Software Development Manager @ GM #IWorkForGM My thoughts are my own.
Alejandro Durante @alitto
74 Followers 330 Following Software Engineer during working hours, human being the rest of the day
drew @coolismyname
142 Followers 2K Following
James B @jameslleb
250 Followers 862 Following @Atlassian ☁️ Webaholic. TypeScript. React. Node. Serverless. Previously: @qantas @farfetch @trivago @zomato
مُدَوَّنة ا... @elbeladi
191 Followers 76 Following as a poet without a state كمَثَلِ شَاعِرٍ تَائِهٍ يَبحَثُ عَن وَطَنٍ
Evgeniy Chernyshev @evgeniyrru
44 Followers 192 Following Rails and JS developer. Linux and khinkali fan.
Alex @alexmarket
2K Followers 2K Following ex DGSCA - ex IADB - ex AstraZeneca - ex SAP - DevOps & CDF Ambassador - former Cheerleader in chief for KMMX, ex @Dynatrace, currently DevOps & IPE at Takeda
Hamid @hamidyfine
50 Followers 410 Following
saban ulutas @sulutas81
2K Followers 5K Following #CompEng #DevOps #SoftwareDev #Beşiktaş ||| Düşüncelerim şahsidir, hiçbir kurumla ilişkisi yoktur ||| Sana Kürşad'ın kinini getirdim ||| 𐱅𐰇𐰼𐰰
Tomas Prieto @Pancakerobot
171 Followers 386 Following Technology and art enthusiast, full stack javascript programmer, computer engineer, instructional designer, and of course pancake connoisseur
Ciprian Magda @ciprianmagda
269 Followers 281 Following
Zelda Cutie @Zelda_Cutie
802 Followers 3K Following I love anything Zelda. MIT Student and a proud geek. #gamergirl #zelda #xboxone #ps4 #blizzard
Jessica L. Hernandez @pc_yassmine
9K Followers 14K Following I tweet news about computer sciences, passionat technological #vendor #webmarketing #software #ipad #mobile #computer #programming #followback
Lalit Shandilya @shanlalit
781 Followers 3K Following Product-minded. Playing Ruby with Rails, Eilxir with Phoenix Framework, and a People First Manager.
Marcos Buzzo @mhbmarcos
72 Followers 756 Following
Omar Jasseh @jassehomar99
123 Followers 951 Following Coder for life. Web & Tech enthusiast. Lifelong learner. Fan of neat Designs & UIs. Craft with PHP and JavaScript. Occasionally share dev tips and resources.
Ivan Estruch @iestruchp
165 Followers 358 Following Frontend developer and #JavaScript fan. Using daily #angularjs and learning #reactjs.