background preloader

Javascript

Facebook Twitter

An introduction to ES6 Part 1: Using ES6 Today. We like to keep up to date with the latest technologies at Global Personals and JavaScript is no exception to that.

An introduction to ES6 Part 1: Using ES6 Today

Over the next few weeks we’ll be introducing you to the evolving ES6 standard and showing you how you can start using the code of the future today. Modern JavaScript: Develop and Design. Welcome to the companion Web pages for the book Modern JavaScript: Develop and Design, written by Larry Ullman and published by Peachpit Press (ISBN 0-321-81252-2).

Modern JavaScript: Develop and Design

The book was published in February 2012. Modern JavaScript: Develop and Design was written to teach JavaScript as a complete programming language. The book does so using practical examples and emphasizing approaches that represent how the language should truly be used today. JS Objects: De"construct"ion. JS Objects: TL;DR JavaScript has been plagued since the beginning with misunderstanding and awkwardness around its "prototypal inheritance" system, mostly due to the fact that "inheritance" isn't how JS works at all, and trying to do that only leads to gotchas and confusions that we have to pave over with user-land helper libs.

JS Objects: De"construct"ion

Instead, embracing that JS has "behavior delegation" (merely delegation links between objects) fits naturally with how JS syntax works, which creates more sensible code without the need of helpers. When you set aside distractions like mixins, polymorphism, composition, classes, constructors, and instances, and only focus on the objects that link to each other, you gain a powerful tool in behavior delegation that is easier to write, reason about, explain, and code-maintain. Simpler is better. Mastering The Developer Tools Console. The developer tools console is one of the most powerful tools available to you when it comes to debugging your front-end web applications.

Mastering The Developer Tools Console

The console has an API that provides a number of methods that make debugging easier. It’s not uncommon to see developers using console.log() or console.dir() to investigate problems; but the developer tools console has a lot more to offer. In this blog post you’re going to learn how to debug your web applications using the methods provided by the console API.

Some browsers support more functionality than others so I’ll be pointing out any compatibility issues as we go. Human JavaScript. Code is as much about people as it is about computers.

Human JavaScript

Sure, it's run by computers, but it's written by, maintained by, and ultimately created for people. People are not computers. We are not robots. JavaScript. JavaScript (JS) is a lightweight, interpreted, programming language with first-class functions.

JavaScript

While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as node.js and Apache CouchDB. JS is a prototype-based, multi-paradigm, dynamic scripting language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles. Read more about JavaScript. Google JavaScript Style Guide. We follow the C++ formatting rules in spirit, with the following additional clarifications.

Google JavaScript Style Guide

Curly Braces Because of implicit semicolon insertion, always start your curly braces on the same line as whatever they're opening. For example: Contents. 7 steps to better JavaScript. Screencast created by Tuts+Premium in association with net magazine and Creative Bloq.

7 steps to better JavaScript

With browser performance improving, along with the steady adoption of new HTML5 APIs, the volume of JavaScript on the web is growing. Yet a single poorly written line of code has the potential to break an entire website, frustrating users and driving away potential customers. Developers must use all the tools and techniques at their disposal to improve the quality of their code to be confident that it can be trusted to execute predictably every time. This is a topic close to my heart and I've been working over many years to find a set of steps to follow during development to ensure only the highest-quality code gets released. Follow these seven steps to dramatically improve the quality of your JavaScript projects. Minify JavaScript - Free JavaScript Compressor.

Debugging JavaScript - Chrome DevTools. JavaScript Reference. These sections explain the elements that make up the JavaScript language.

JavaScript Reference

JavaScript code in Internet Explorer can interact with HTML, CSS and the Document Object Model (DOM), which represents HTML and browser objects. For information about HTML, see HTML/XHTML Reference. For information about CSS, see Cascading Style Sheets. For information about the DOM, see Document Object Model (DOM). JavaScript code can be used in browser applications as well as Windows Store apps. For information about JavaScript in Windows Store apps, see JavaScript roadmap. Provides a list of JavaScript language features and the Internet Explorer versions in which they were introduced. Provides a list of objects with links to information about each object. Provides a list of constants and links to information about each constant. JavaScript reference. JavaScript is a scripting language primarily used in Web applications.

JavaScript reference

It allows authors to create dynamic HTML (DHTML) pages. Rainbow - Javascript Code Syntax Highlighting. Secrets of the Browser Developer Tools - Secrets. An Introduciton to Firebug. Build Better Pages With Firebug. Ask web developers to name their desert island Firefox extensions (ignoring for now the improbability of having a laptop while stranded), and they’re bound to put Firebug at or near the top of their lists. Firebug Guide for Web Designers. Firebug — an open source web development tool extension for the Mozilla Firefox web browser — is incredibly powerful, with a wide range of super useful and practical features that would benefit any web designer or developer.

In fact, this browser extension (also available in other web browsers with limited functionality) is so useful and popular that it has browser extensions of its own. This real-time coding tool reduces the guesswork out of debugging web pages, among many other things such web page layout inspection/testing and web performance profiling, to speed up your workflow. Whether you’re building a web page, adding new CSS for a responsive web design, troubleshooting web layout issues, or inspecting how other websites are built, Firebug is going to be a valuable tool in your arsenal. Let’s take a closer look at how this indispensable browser extension can help web designers. We’ll only focus on certain Firebug functionalities that are especially helpful for web designers. JavaScript Design Patterns and CSS Windows. In this episode of The Treehouse Show, Nick Pettit (@nickrp) and Jason Seifer (@jseifer) talk about JavaScript Design Patterns and CSS Windows.

Here are the links for the week: JavaScript Module Pattern: In-Depth. The module pattern is a common JavaScript coding pattern. It’s generally well understood, but there are a number of advanced uses that have not gotten a lot of attention. In this article, I’ll review the basics and cover some truly remarkable advanced topics, including one which I think is original. The Basics We’ll start out with a simple overview of the module pattern, which has been well-known since Eric Miraglia (of YUI) first blogged about it three years ago. JavaScript Patterns. The 10 Best JavaScript Development and Design Habits. JavaScript is an easy language to use, and a necessary one in today’s web.

So much so that many developers come to JavaScript without any formal programming education. Hence, it’s not uncommon for developers to have years of JavaScript practice (or experimentation) under their belts without ever having established some best development and design habits. In this article, Larry Ullman outlines 10 guidelines that'll help every developer code more effectively. JavaScript is a very approachable language, one that forgoes the need for the daunting compilation or installation that comes with other languages like C, Java, PHP, or Ruby. Do a little bit of research online, slap together some code, and you can probably accomplish what you need to do. In writing this article, I originally came up with a long list of suggestions, including some common and specific points such as not using the eval() function.

Document Your Code! Be Consistent Test/Handle Errors Master a Text Editor or IDE Conclusion. Prefix free: Break free from CSS vendor prefix hell! -prefix-free lets you use only unprefixed CSS properties everywhere. It works behind the scenes, adding the current browser’s prefix to any CSS code, only when it’s needed.

The target browser support is IE9+, Opera 10+, Firefox 3.5+, Safari 4+ and Chrome on desktop and Mobile Safari, Android browser, Chrome and Opera Mobile on mobile. If it doesn’t work in any of those, it’s a bug so please report it. Just before you do, please make sure that it’s not because the browser doesn’t support a CSS3 feature at all, even with a prefix.