background preloader

JavaScript

Facebook Twitter

Anjana Vakil: Learning Functional Programming with JavaScript - JSUnconf 2016. GitHub - adam-s/js-interview-review: The JS interview review. As I'm reviewing several resources I've bookmarked on JavaScript development, I'll share them here. Introduction to asynchronous JavaScript. In JavaScript we often need to deal with asynchronous behavior, which can be confusing for programmers who only have experience with synchronous code.

Introduction to asynchronous JavaScript

This article will explain what asynchronous code is, some of the difficulties of using asynchronous code, and ways of handling these difficulties. What is the difference between synchronous and asynchronous code? Synchronous code In synchronous programs, if you have two lines of code (L1 followed by L2), then L2 cannot begin running until L1 has finished executing. You can imagine this as if you are in a line of people waiting to buy train tickets.

Asynchronous code In asynchronous programs, you can have two lines of code (L1 followed by L2), where L1 schedules some task to be run in the future, but L2 runs before that task completes. You can imagine as if you are eating at a sit-down restaurant. Note that asynchronous does not mean the same thing as concurrent or multi-threaded. Examples Say "Hello".Do nothing for two seconds.Say "Goodbye! " Javascript for Java Developers. This post will go over the Javascript language from the point of view of a Java developer, focusing on the differences between the two languages and the frequent pain points.

Javascript for Java Developers

We will go over the following: Objects Only, No ClassesFunctions are just ValuesThe 'this' Keyword Classic vs Prototypal InheritanceConstructors vs Constructor FunctionsClosures vs LambdasEncapsulation and ModulesBlock Scope and Hoisting Why Javascript in the Java World ? A Taste of JavaScript’s New Parallel Primitives. TL;DR – We’re extending JavaScript with a primitive API that lets programmers use multiple workers and shared memory to implement true parallel algorithms in JavaScript.

A Taste of JavaScript’s New Parallel Primitives

Multicore computation JavaScript (JS) has grown up, and it works so well that virtually every modern web page contains large amounts of JS code that we don’t ever worry about — it just runs as a matter of course. ECMAScript Next compatibility table. Where do you use closures in JavaScript? - Quora. JavaScript Module Systems Showdown: CommonJS vs AMD vs ES2015. As JavaScript development gets more and more common, namespaces and dependencies get much more difficult to handle.

JavaScript Module Systems Showdown: CommonJS vs AMD vs ES2015

Different solutions were developed to deal with this problem in the form of module systems. In this post, we will explore the different solutions currently employed by developers and the problems they try to solve. Read on! Introduction: Why Are JavaScript Modules Needed? If you are familiar with other development platforms, you probably have some notion of the concepts of encapsulation and dependency. Encapsulation is essential to prevent conflicts and ease development.

When it comes to dependencies, in traditional client-side JavaScript development, they are implicit. The following example is part of Backbone.js's examples. As JavaScript development gets more and more complex, dependency management can get cumbersome. JavaScript module systems attempt to deal with these problems and others. An Ad Hoc Solution: The Revealing Module Pattern Pros Cons CommonJS.

JavaScript Testing: Unit vs Functional vs Integration Tests. Unit tests, integration tests, and functional tests are all types of automated tests which form essential cornerstones of continuous delivery, a development methodology that allows you to safely ship changes to production in days or hours rather than months or years.

JavaScript Testing: Unit vs Functional vs Integration Tests

Automated tests enhance software stability by catching more errors before software reaches the end user. They provide a safety net that allows developers to make changes without fear that they will unknowingly break something in the process. The Cost of Neglecting Tests Contrary to popular intuition, maintaining a quality test suite can dramatically enhance developer productivity by catching errors immediately.

182 JSJ RxJS with Matthew Podwysocki - Javascript Jabber - Devchat.tv. [This episode is sponsored by FrontEnd Masters.

182 JSJ RxJS with Matthew Podwysocki - Javascript Jabber - Devchat.tv

They have a terrific lineup of live courses you can attend either online or in person. They also have a terrific backlog of courses you can watch including JavaScript the Good Parts, Build Web Applications with Node.js, AngularJS In-Depth, and Advanced JavaScript. You can go check them out at FrontEndMasters.com.] [This episode is sponsored by Hired.com. Every week on Hired, they run an auction where over a thousand tech companies in San Francisco, New York, and L.A. bid on JavaScript developers, providing them with salary and equity upfront.

A Plain English Guide to JavaScript Prototypes - Sebastian's Blog. When I first started learning about JavaScript object model my reaction was of horror and disbelief.

A Plain English Guide to JavaScript Prototypes - Sebastian's Blog

I was totally puzzled by its prototype nature as it was my first encounter with a prototype based language. I didn’t help that JavaScript has a unique take on prototypes as it adds the concept of function constructors. Building a Gulp API Compatible Task Automation Tool. Front-end developers nowadays are using multiple tools to automate routine operations.

Building a Gulp API Compatible Task Automation Tool

Three of the most popular solutions are Grunt, Gulp and Webpack. Each of these tools are built on different philosophies, but they share the same common goal: to streamline the front-end build process. For example, Grunt is configuration-driven while Gulp enforces almost nothing. In fact, Gulp relies on the developer writing code to implement the flow of the build processes - the various build tasks. When it comes to choosing one of these tools, my personal favorite is Gulp.

Gulp API Gulp comes with just four simple functions: gulp.task gulp.src gulp.dest gulp.watch These four simple functions, in various combinations offer all the power and flexibility of Gulp. Out of these four functions, the first three are absolutely essential for any Gulp file. allowing tasks to be defined and invoked from the command line interface. Understanding the prototype property in JavaScript.

You’re having difficulty understanding the prototype property in JavaScript.

Understanding the prototype property in JavaScript

You know it has got to do with object-oriented programming (OOP) and object inheritance, but you're not sure of the mechanics of how it works. Prototypal inheritance Object-oriented programming can be implemented in many ways. Other languages, such as Java, use class-based model where the language separates classes and instances of objects. Understanding JavaScript Modules: Bundling & Transpiling. This article was peer reviewed by Dan Prince and Ravi Kiran.

Understanding JavaScript Modules: Bundling & Transpiling

Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! Most folks consider modules, dependency management and dynamic loading a basic requirement for any modern programming language—these are some of the most important features added to JavaScript in 2015. Modules are used extensively in Node but our focus here will be on how we can use modules inside of the browser. We’ll explore a little history, navigate through the hazardous current landscape with the end goal of having a clear path forward and appreciation for the most important module bundlers for JavaScript today: Browserify, Webpack and jspm. Finally we’ll look at how to use these tools with transpilers like CoffeeScript, TypeScript and Babel. A Guide to Proper Error Handling in JavaScript. This article was peer reviewed by Tim Severien and Moritz Kröger.

Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! Ah, the perils of error handling in JavaScript. If you believe Murphyʼs law, anything that can go wrong, will go wrong! In this article I would like to explore error handling in JavaScript. I will cover pitfalls and good practices. Creating Desktop Apps with Electron. Optimizing JavaScript Performance With Firefox Dev Tools. Debugging techniques with Javascript - Spacedojo Code Kata. 75: Best Practices Series: JavaScript. Tools to Learn JavaScript By Doing -Telerik Developer Network. …or how solving code puzzles can be your path to enlightenment.

Whenever I’m asked how a developer can learn more about a particular language, I stress that it’s crucial to find the technique that works best for you. Most folks can think of a few immediate ways to pick up a new language: BooksConferencesClassroom study While these work, they’ve always had a few drawbacks for me.

When it comes to books, I find that they are only effective if I read them while I’m sitting by my computer. Because I love reading so much, I actively try not to read by my computer. Conferences are great, but typically they give you a 60 minute intro to a language or topic, and at best inspire you to work on it more on your own time. And of course – actually spending time in a classroom can be incredibly productive. One thing you may notice about the suggestions above is that in each case, I talk about “playing” or working on code while I’m learning.

Sinon Tutorial: JavaScript Testing with Mocks, Spies & Stubs. This article was peer reviewed by Mark Brown and MarcTowler. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be! One of the biggest stumbling blocks when writing unit tests is what to do when you have code that’s non-trivial. In real life projects, code often does all kinds of things that make testing hard. Ajax requests, timers, dates, accessing other browser features… or if you’re using Node.js, databases are always fun, and so is network or file access. How to async in JavaScript. Marek Nogiec Front-end Enthusiast I’d like to share with you a few different ways of writing asynchronous code in JavaScript. Whether you’re writing for the browser or building complex Node.js apps you might find some useful tips how to improve the quality and readability of your code either by using popular techniques or some more experimental solutions. What do we want to achieve I’m a big fan of talking about code using live examples and not just theory, so this article will be based on a few snippets of code.

It’ll be some simple code to get data from an external API, for which I’ll use a fun little project getting quotes from Ron Swanson. Writing Testable Code in JavaScript. Whether we’re using Node paired with a test framework like Mocha or Jasmine, or spinning up DOM-dependent tests in a headless browser like PhantomJS, our options for unit testing JavaScript are better now than ever. However, this doesn’t mean the code we’re testing is as easy on us as our tools are!

Organizing and writing code that is easily testable takes some effort and planning, but there are a few patterns, inspired by functional programming concepts, that we can use to avoid getting into a tough spot when it comes time to test our code. In this article, we will go through some useful tips and patterns for writing testable code in JavaScript.

Keep Business Logic and Display Logic Separate One of the primary jobs of a JavaScript-based browser application is listening to DOM events triggered by the end user, and then responding to them by running some business logic and displaying the results on the page. A Baseline for Front-End [JS] Developers, 2015. 23 Mar 2015 edit. Data Structures in JavaScript posts - Ben's Blog. GitHub - vasanthk/js-bits: JavaScript concepts with code! JavaScript Frameworks in 2016. As JavaScript's popularity continues to grow and with it, the surrounding ecosystem of modern libraries & tools, it can sometimes be hard to keep-up, leading to what some describe as JavaScript Fatigue. Quick Tip: Stop Writing Loops and Start Thinking with Maps. Speaking JavaScript.

Battle of the Free Code Editors -Telerik Developer Network. Hello, my name is Brian and I play a developer online and at conferences. Pro JavaScript Concepts for Enterprise Developers -Telerik Developer Network. Leveling Up Your JavaScript - Telerik Developer Network. JavaScript is one of those languages that can be easy to pick up, it can be infinitely more difficult to master. However, a lot of articles seem to assume that you are already a master. A Gentle Introduction to Functional JavaScript: Part 1. Building ES6 Javascript for the Browser with Gulp, Babel, and More.

ECMAScript 6 is the most recent update to Javascript, and with it has come a lot of new features to the language – some that the community has been begging for, and also some that are pretty controversial. Exploring ES6 by Axel Rauschmayer. What is the best way to learn JavaScript? How to learn and become a master at JavaScript. Google JavaScript Style Guide. We follow the C++ formatting rules in spirit, with the following additional clarifications. Curly Braces Because of implicit semicolon insertion, always start your curly braces on the same line as whatever they're opening.

Object-oriented design in JavaScript games. Introduction In this article, learn about OOP in JavaScript, and explore the prototypical and classical inheritance models. Examples explain common patterns in games that can greatly benefit from the structure and maintainability of OOP design. The ultimate goal is that each piece of code is human-readable and represents an idea and a single purpose, altogether transcending a set of instructions and algorithms to become a finely-tuned work of art.

Understand memory leaks in JavaScript applications. Get started with object-oriented JavaScript code. Java development 2.0: JavaScript for Java developers. Get started with the JavaScript language, Part 1: JavaScript language fundamentals. Compare JavaScript frameworks. Eloquent JavaScript. JavaScript.