This session is an introduction to the weird side of JavaScript, and it definitely has a weird side! .NET developers will find a lot of intriguing "features" when they begin to write code in the world's most widely used language. Join us to learn about all the gotchas to watch out for and discover some of the great functionality that JavaScript has to offer…
Things that every JavaScript developer should know by Rachel Appel at FrontCo...DevClub_lv
JavaScript can be a passive-aggressive and fickle language that can frustrate you at every turn. It lets you do things like declare variables anywhere, but doesn’t tell you that it will hoist them while you’re not looking. Learn how JavaScript organizes data by using key-based dictionaries and how it handles functions behind the scenes. Additionally, you'll learn how JavaScript uses arrow functions, closures, prototypes and inheritance, equality, and more.
In this session, you'll learn little known facts about JavaScript, as well as frequently experienced JavaScript headaches and mistakes, and ways to avoid them. Learn these key facets of JavaScript and take your knowledge to the next level!
Exploring Kotlin language basics for Android App developmentJayaprakash R
Kotlin is a new programming language that targets JVM, Android and JavaScript. It is 100% interoperable with Java and avoids NullPointerExceptions. Some key features include lambda expressions, immutable val properties, smart casting, and named arguments. Kotlin code can use existing Java frameworks and libraries. Data classes, sealed classes, and when expressions make the code cleaner. Best practices include using apply() for object initialization and named arguments instead of method chaining.
Metaprogramming involves writing computer programs that manipulate or generate other programs. It allows for more elegant code, less boilerplate code, and hiding implementation details. The document discusses different ways metaprogramming is implemented in JavaScript, including dynamic features like reflection, getters/setters, proxies, decorators, and generators, as well as code generation approaches. Real-world examples of metaprogramming include frameworks, domain-specific languages, and adding functionality without cluttering main logic.
JavaScript operators allow manipulation of values and perform computations on operands. There are various types of operators including arithmetic, assignment, comparison, logical, and ternary operators. Arithmetic operators perform math operations like addition, subtraction, multiplication, and division on operands.
This document provides an overview of actor modeling and how to implement actors using the Akka library. It begins with explaining the actor model and benefits of actors over threads. It then discusses how to create actors with Akka, demonstrating with a multiplayer chess game. The schedule outlines explaining the actor model for 1/4 of the time and how to create Akka actors for 3/4 of the time using the chess game demo. Useful links are provided for Akka documentation and chess/game related projects.
Object Oriented Programming In JavaScriptForziatech
This document provides an overview of object oriented programming concepts in JavaScript. It discusses how JavaScript supports OOP through prototypes, functions acting as classes, and constructor functions to initialize objects. The document also covers data types in JavaScript, error handling using try/catch blocks, and techniques to improve performance such as reducing DOM access and unnecessary variables. It provides examples of implementing inheritance, abstraction, polymorphism, and other OOP principles in JavaScript.
The Airbnb JavaScript Style Guide provides best practices for writing readable, maintainable JavaScript code. It recommends using const and let instead of var, object literal syntax over object constructors, and arrow functions over function expressions. It also provides guidelines for formatting functions, comparisons, iterators, commas and comments. The style guide is based on Airbnb's configuration files for linters like ESLint, JSHint and JSCS to enforce code quality and style standards.
Things that every JavaScript developer should know by Rachel Appel at FrontCo...DevClub_lv
JavaScript can be a passive-aggressive and fickle language that can frustrate you at every turn. It lets you do things like declare variables anywhere, but doesn’t tell you that it will hoist them while you’re not looking. Learn how JavaScript organizes data by using key-based dictionaries and how it handles functions behind the scenes. Additionally, you'll learn how JavaScript uses arrow functions, closures, prototypes and inheritance, equality, and more.
In this session, you'll learn little known facts about JavaScript, as well as frequently experienced JavaScript headaches and mistakes, and ways to avoid them. Learn these key facets of JavaScript and take your knowledge to the next level!
Exploring Kotlin language basics for Android App developmentJayaprakash R
Kotlin is a new programming language that targets JVM, Android and JavaScript. It is 100% interoperable with Java and avoids NullPointerExceptions. Some key features include lambda expressions, immutable val properties, smart casting, and named arguments. Kotlin code can use existing Java frameworks and libraries. Data classes, sealed classes, and when expressions make the code cleaner. Best practices include using apply() for object initialization and named arguments instead of method chaining.
Metaprogramming involves writing computer programs that manipulate or generate other programs. It allows for more elegant code, less boilerplate code, and hiding implementation details. The document discusses different ways metaprogramming is implemented in JavaScript, including dynamic features like reflection, getters/setters, proxies, decorators, and generators, as well as code generation approaches. Real-world examples of metaprogramming include frameworks, domain-specific languages, and adding functionality without cluttering main logic.
JavaScript operators allow manipulation of values and perform computations on operands. There are various types of operators including arithmetic, assignment, comparison, logical, and ternary operators. Arithmetic operators perform math operations like addition, subtraction, multiplication, and division on operands.
This document provides an overview of actor modeling and how to implement actors using the Akka library. It begins with explaining the actor model and benefits of actors over threads. It then discusses how to create actors with Akka, demonstrating with a multiplayer chess game. The schedule outlines explaining the actor model for 1/4 of the time and how to create Akka actors for 3/4 of the time using the chess game demo. Useful links are provided for Akka documentation and chess/game related projects.
Object Oriented Programming In JavaScriptForziatech
This document provides an overview of object oriented programming concepts in JavaScript. It discusses how JavaScript supports OOP through prototypes, functions acting as classes, and constructor functions to initialize objects. The document also covers data types in JavaScript, error handling using try/catch blocks, and techniques to improve performance such as reducing DOM access and unnecessary variables. It provides examples of implementing inheritance, abstraction, polymorphism, and other OOP principles in JavaScript.
The Airbnb JavaScript Style Guide provides best practices for writing readable, maintainable JavaScript code. It recommends using const and let instead of var, object literal syntax over object constructors, and arrow functions over function expressions. It also provides guidelines for formatting functions, comparisons, iterators, commas and comments. The style guide is based on Airbnb's configuration files for linters like ESLint, JSHint and JSCS to enforce code quality and style standards.
Paris Web - Javascript as a programming languageMarco Cedaro
How to setup up a stable javascript continuous integration environment and why you need it. Through a real life example, the talk explains all the benefits of having a development process that brings real control over javascript codebase. A deep analysis of developer and webapps needs and of the tools that fit those requirements.
Functional programming has started (re)gaining prominence in recent years, and with good reason too. Functional programs lend an elegant solution to the concurrency problem, result in more modular systems, are more concise and are easier to test. While modern languages like Scala and Clojure have embraced the functional style whole-heartedly, Java has lagged a bit behind in its treatment of functions as first-class citizens. With the advent of Java 8 and its support for lambdas, however, Java programmers can finally start reaping the power of functional programs as well. Even without Java 8, it is possible to adopt a functional style with the aid of excellent libraries such as Guava.
This document discusses the advantages of using TypeScript for developing Angular applications. It begins with an introduction to TypeScript, including how it adds types and classes to JavaScript to improve code structure and tooling. The presenter then demonstrates how to write an Angular todo list application using TypeScript, comparing the syntax for services, controllers, and directives between regular JavaScript and TypeScript implementations. Decorators are also introduced as how Angular 2.0 will annotate classes and properties. Overall, TypeScript is shown to add significant benefits for organizing code and developing Angular applications.
This document is an introduction to JavaScript presented by Jamal O'Garro of Code Crew. It covers the basics of JavaScript including data types, operators, variables, functions, objects, and the DOM. It also discusses more advanced topics like object-oriented JavaScript, prototypal inheritance, AJAX, APIs, frameworks, and Node.js. The goal is to provide an overview of the core concepts and capabilities of the JavaScript programming language.
The document is an agenda for a presentation on JavaScript that covers introduction to JavaScript, working with objects, working with functions, details of the object model including public, private, privileged and static members as well as inheritance, and practical closures. It provides explanations and examples of key JavaScript concepts like dynamic and loosely typed features, prototype-based programming, language features such as first-class functions and closures, creating and working with objects and properties, creating functions and using them as objects, and anonymous functions.
This document provides an introduction to object oriented JavaScript. It covers JavaScript basics like variables, operators, and functions. It discusses objects, prototypes, and inheritance. It explains special functions like bind, call, apply. It covers callbacks, promises, and asynchronous programming. It discusses topics like this, closures, and controlling asynchronous flow. The document is an agenda that provides an overview of key concepts in object oriented JavaScript.
Why I don’t want to develop iOS apps in Objective CSeniorDevOnly
Sergey Shulga has shared with the audience his belief in Power of Swift. Also he has explained why does he think that it’s future not only of iOS and Mac OS development. From Sergey presentation we also got to know some cool Swift libraries. Follow our Speaker on Twitter: @SergDort
The document provides information about a mentoring program run by Baabtra-Mentoring Partner including a trainee's typing speed progress over 3 weeks, jobs applied to with current statuses, an introduction to functions in Javascript covering definitions, advantages, examples, and local and global variables. Contact details for Baabtra are also provided at the end.
This document discusses advanced reflection capabilities in Pharo. It describes how instance variables are currently represented as strings but could be modeled as objects using layouts and slots. It also explains how method structures are not currently modeled at a fine-grained level and proposes using abstract syntax trees (ASTs) to represent methods as objects with sub-elements like message sends, assignments, and variable access. This would enable capabilities like behavioral reflection through meta-object links on AST nodes. The document advocates "ASTs everywhere" and sub-method reflection with meta-links in future versions of Pharo.
Microsoft Typescript is a statically typed compiled language to clean and a simple plain old JavaScript code which runs on any browser, in Node.js or in any JavaScript engine that supports ECMAScript 3 (or newer).
This document introduces TypeScript for Java developers. It provides an overview of TypeScript, why to use it, how to get started, and examples of key TypeScript features like classes, interfaces, generics, decorators, and async/await. The author is an Angular practice lead and Java Champion who has authored books on Angular development with TypeScript. The document demonstrates how to set up a TypeScript environment and compile code, and provides code samples for many TypeScript language features and patterns.
TypeScript 2 provides several new features that improve type safety when using TypeScript with libraries like React and Redux. These include non-nullable types to prevent null/undefined errors, literal types for exact string/number values, discriminated union types for handling different action types in Redux, and mapped/partial types for better React prop and state typing. Overall, TypeScript 2 enhances type checking and brings tighter integration with popular JavaScript frameworks and patterns.
This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
Null is problematic in programming because it does not behave like a valid object and can cause errors. Several alternatives to null are proposed, including null objects that define neutral behavior, Options/Some-None patterns that encapsulate null, and defensive programming techniques like not allowing null parameters. The document discusses these approaches and recommends Options/Some-None as an ideal pattern for APIs to clearly indicate intentions and avoid null issues.
Dynamically Composing Collection Operations through Collection PromisesMarcus Denker
Dynamically Composing Collection Operations through Collection Promises.
Juan Pablo Sandoval Alcocer, Marcus Denker,
Alexandre Bergel, Yasett Acuran
Presented at IWST 2016
This document discusses new developments in variable representation in Pharo5. It notes that everything used to be represented as objects, including variables, but variables were represented via associations. In Pharo5, variables are now represented as subclasses of objects called slots and literals. This allows variables to be annotated and have custom behavior via delegation to their metaobjects during code generation. It provides examples of using simple slots, weak slots, and property slots, and outlines the roadmap for further developing the slot system in Pharo6.
JavaScript allows for metaprogramming through manipulating programs as data. It relies on few but powerful constructs including working with functions, arguments, built-in types, and mechanisms like inheritance at runtime. The key building blocks are objects, numbers, strings, booleans, and undefined, with everything else being objects. Functions are objects that can return other functions, taking advantage of closures to refer to outer variables from inner functions. This flexibility allows for patching implementations, self-optimizing code, custom APIs, and domain-specific languages.
Social Software and the Day School Librarianwasagooze
The document introduces various social software tools that can be used by school librarians, including blogs, wikis, RSS, and social networks. It discusses how these tools can be used for creative writing assignments, student ownership, and meeting students in their digital world. Examples are provided of how blogs can be used for library news and book reviews, and wikis can be used for pathfinders, group projects, and events.
Blackboard 7.1 introduces new discussion board features like forced moderation and discussion subscription. It also improves assessments with multiple test attempts and the ability to export tests and surveys. Other new capabilities include cross-platform text editing, spell check in email, and adaptive release for controlling content visibility.
Paris Web - Javascript as a programming languageMarco Cedaro
How to setup up a stable javascript continuous integration environment and why you need it. Through a real life example, the talk explains all the benefits of having a development process that brings real control over javascript codebase. A deep analysis of developer and webapps needs and of the tools that fit those requirements.
Functional programming has started (re)gaining prominence in recent years, and with good reason too. Functional programs lend an elegant solution to the concurrency problem, result in more modular systems, are more concise and are easier to test. While modern languages like Scala and Clojure have embraced the functional style whole-heartedly, Java has lagged a bit behind in its treatment of functions as first-class citizens. With the advent of Java 8 and its support for lambdas, however, Java programmers can finally start reaping the power of functional programs as well. Even without Java 8, it is possible to adopt a functional style with the aid of excellent libraries such as Guava.
This document discusses the advantages of using TypeScript for developing Angular applications. It begins with an introduction to TypeScript, including how it adds types and classes to JavaScript to improve code structure and tooling. The presenter then demonstrates how to write an Angular todo list application using TypeScript, comparing the syntax for services, controllers, and directives between regular JavaScript and TypeScript implementations. Decorators are also introduced as how Angular 2.0 will annotate classes and properties. Overall, TypeScript is shown to add significant benefits for organizing code and developing Angular applications.
This document is an introduction to JavaScript presented by Jamal O'Garro of Code Crew. It covers the basics of JavaScript including data types, operators, variables, functions, objects, and the DOM. It also discusses more advanced topics like object-oriented JavaScript, prototypal inheritance, AJAX, APIs, frameworks, and Node.js. The goal is to provide an overview of the core concepts and capabilities of the JavaScript programming language.
The document is an agenda for a presentation on JavaScript that covers introduction to JavaScript, working with objects, working with functions, details of the object model including public, private, privileged and static members as well as inheritance, and practical closures. It provides explanations and examples of key JavaScript concepts like dynamic and loosely typed features, prototype-based programming, language features such as first-class functions and closures, creating and working with objects and properties, creating functions and using them as objects, and anonymous functions.
This document provides an introduction to object oriented JavaScript. It covers JavaScript basics like variables, operators, and functions. It discusses objects, prototypes, and inheritance. It explains special functions like bind, call, apply. It covers callbacks, promises, and asynchronous programming. It discusses topics like this, closures, and controlling asynchronous flow. The document is an agenda that provides an overview of key concepts in object oriented JavaScript.
Why I don’t want to develop iOS apps in Objective CSeniorDevOnly
Sergey Shulga has shared with the audience his belief in Power of Swift. Also he has explained why does he think that it’s future not only of iOS and Mac OS development. From Sergey presentation we also got to know some cool Swift libraries. Follow our Speaker on Twitter: @SergDort
The document provides information about a mentoring program run by Baabtra-Mentoring Partner including a trainee's typing speed progress over 3 weeks, jobs applied to with current statuses, an introduction to functions in Javascript covering definitions, advantages, examples, and local and global variables. Contact details for Baabtra are also provided at the end.
This document discusses advanced reflection capabilities in Pharo. It describes how instance variables are currently represented as strings but could be modeled as objects using layouts and slots. It also explains how method structures are not currently modeled at a fine-grained level and proposes using abstract syntax trees (ASTs) to represent methods as objects with sub-elements like message sends, assignments, and variable access. This would enable capabilities like behavioral reflection through meta-object links on AST nodes. The document advocates "ASTs everywhere" and sub-method reflection with meta-links in future versions of Pharo.
Microsoft Typescript is a statically typed compiled language to clean and a simple plain old JavaScript code which runs on any browser, in Node.js or in any JavaScript engine that supports ECMAScript 3 (or newer).
This document introduces TypeScript for Java developers. It provides an overview of TypeScript, why to use it, how to get started, and examples of key TypeScript features like classes, interfaces, generics, decorators, and async/await. The author is an Angular practice lead and Java Champion who has authored books on Angular development with TypeScript. The document demonstrates how to set up a TypeScript environment and compile code, and provides code samples for many TypeScript language features and patterns.
TypeScript 2 provides several new features that improve type safety when using TypeScript with libraries like React and Redux. These include non-nullable types to prevent null/undefined errors, literal types for exact string/number values, discriminated union types for handling different action types in Redux, and mapped/partial types for better React prop and state typing. Overall, TypeScript 2 enhances type checking and brings tighter integration with popular JavaScript frameworks and patterns.
This is an intermediate conversion course for C++, suitable for second year computing students who may have learned Java or another language in first year.
Null is problematic in programming because it does not behave like a valid object and can cause errors. Several alternatives to null are proposed, including null objects that define neutral behavior, Options/Some-None patterns that encapsulate null, and defensive programming techniques like not allowing null parameters. The document discusses these approaches and recommends Options/Some-None as an ideal pattern for APIs to clearly indicate intentions and avoid null issues.
Dynamically Composing Collection Operations through Collection PromisesMarcus Denker
Dynamically Composing Collection Operations through Collection Promises.
Juan Pablo Sandoval Alcocer, Marcus Denker,
Alexandre Bergel, Yasett Acuran
Presented at IWST 2016
This document discusses new developments in variable representation in Pharo5. It notes that everything used to be represented as objects, including variables, but variables were represented via associations. In Pharo5, variables are now represented as subclasses of objects called slots and literals. This allows variables to be annotated and have custom behavior via delegation to their metaobjects during code generation. It provides examples of using simple slots, weak slots, and property slots, and outlines the roadmap for further developing the slot system in Pharo6.
JavaScript allows for metaprogramming through manipulating programs as data. It relies on few but powerful constructs including working with functions, arguments, built-in types, and mechanisms like inheritance at runtime. The key building blocks are objects, numbers, strings, booleans, and undefined, with everything else being objects. Functions are objects that can return other functions, taking advantage of closures to refer to outer variables from inner functions. This flexibility allows for patching implementations, self-optimizing code, custom APIs, and domain-specific languages.
Social Software and the Day School Librarianwasagooze
The document introduces various social software tools that can be used by school librarians, including blogs, wikis, RSS, and social networks. It discusses how these tools can be used for creative writing assignments, student ownership, and meeting students in their digital world. Examples are provided of how blogs can be used for library news and book reviews, and wikis can be used for pathfinders, group projects, and events.
Blackboard 7.1 introduces new discussion board features like forced moderation and discussion subscription. It also improves assessments with multiple test attempts and the ability to export tests and surveys. Other new capabilities include cross-platform text editing, spell check in email, and adaptive release for controlling content visibility.
Analyzing probabilistic models in hierarchical BOA on traps and spin glasseskknsastry
The hierarchical Bayesian optimization algorithm (hBOA) can solve nearly decomposable and hierarchical problems of bounded difficulty in a robust and scalable manner by building and sampling probabilistic models of promising solutions. This paper analyzes probabilistic models in hBOA on two common test problems: concatenated traps and 2D Ising spin glasses with periodic boundary conditions. We argue that although Bayesian networks with local structures can encode complex probability distributions, analyzing these models in hBOA is relatively straightforward and the results of such analyses may provide practitioners with useful information about their problems. The results show that the probabilistic models in hBOA closely correspond to the structure of the underlying optimization problem, the models do not change significantly in subsequent iterations of BOA, and creating adequate probabilistic models by hand is not straightforward even with complete knowledge of the optimization problem.
Esta apresentação retrata a trajetória da SILVIO BOLSAS, uma empresa líder de mercado em seu segmento, a qual está sempre voltada para a invovação e a satisfação de seus clientes.
The letter is addressed to Mr. Bean and discusses an upcoming meeting. The writer confirms that the meeting will take place on Friday at 10am in the boardroom to discuss the company's quarterly earnings report and strategy for the next quarter. All relevant staff members are expected to attend and should come prepared to provide input and feedback.
Techorama - Evolvable Application Development with MongoDBbwullems
The document discusses evolvable application development with MongoDB. It provides an overview of MongoDB, including that it is a general purpose, document oriented database using JSON syntax. It discusses how MongoDB allows flexibility in schema design and supports evolutionary changes. The document then covers various aspects of using MongoDB like modeling data, CRUD operations, optimizations like indexing, and aggregation capabilities. It notes some benefits like scalability and ease of use but also drawbacks like lack of data integrity checks. It concludes with a list of additional topics not covered like security, references, write concerns, and sharding.
Centralized Source Control Systems are so 90’s. Forget Team Foundation Server, Subversion,… Today it’s all about Distributed Source Control systems. Working with many developers on the same project, using lots of branches, managing versions and releases will no longer be a painful experience.
Let’s have a (first) look together at GIT and GITHub and how this will simplify your life as a .NET developer.
This document provides an overview of popular JavaScript libraries including Dojo Toolkit, YUI, Prototype, and jQuery. It discusses problems they aim to solve like cross-browser inconsistencies. Key features of each library are mentioned like Dojo's widgets, YUI's controls, Prototype's Ruby-like syntax, and jQuery's chaining and node selection. The document also covers ideas from the libraries like progressive enhancement, animation APIs, and leveraging hosting on CDNs.
The document describes a Windows Phone application called TFS Monitor that allows users to monitor, track, and manage projects and data from their mobile phone through an interface connected to Team Foundation Server. Key features highlighted include getting real-time updates on project status, builds, work items and source control changes, as well as notifications of events. The application allows viewing and managing team projects, tracking bugs and tasks, monitoring builds, and viewing build details. It is available for free download from the Marketplace.
Building an enterprise app in silverlight 4 and NHibernatebwullems
This document discusses building an enterprise application using Silverlight, NHibernate, and following CQRS and MVVM patterns. It recommends using OData to implement the query model in CQRS and NHibernate for the domain model. It then covers implementing the front-end using MVVM principles in Silverlight, including using view models, commands, and an event aggregator for communication between view models. Demo code is provided for various aspects like OData queries, NHibernate usage, implementing a base view model, locator pattern, MEF, and unit testing view models.
1) Convention over Configuration is a software design paradigm that seeks to decrease the number of decisions developers need to make by introducing conventions or standard ways of doing things. This gains simplicity without necessarily losing flexibility.
2) In .NET, configuration was historically used for many things like settings, but this led to problems like "XML Hell" with too much configuration.
3) .NET 4.0 and other frameworks are embracing conventions over configuration, by standardizing naming, structure, and other conventions to remove the need for extensive configuration files and code.
Caliburn.Micro is an MVVM framework that aims to simplify building WPF, Silverlight, and Windows Phone applications using common UI patterns like MVVM. It provides features like automatic view-viewmodel resolution through conventions, an event aggregator for loose coupling between components, window management, and coroutines for asynchronous programming. The framework handles common tasks like UI lifecycle management and removes much of the boilerplate code associated with building MVVM applications.
Brief explanation of javascript language for intermediates
Topics Covered
~ Why do we need javascript
~ javascript vs traditional language
~ functions and objects ( sample code )
~ prototypal inheritance ( sample code )
~ variable scope ( sample code )
~ closure (sample code )
~ callbacks
~ events
~ the confusion of 'this'
~ popular frameworks
Client-side scripting is performed using JavaScript to generate code that runs in the browser without server processing. JavaScript is used to create dynamic and interactive web pages by adding functionality and behaviors. It is the most commonly used programming language for building websites. JavaScript allows client-side validation, user notifications, simple calculations and greater control of the web page interface.
This document discusses JavaScript's primitive data types and scopes. It notes that JS only has 3 primitive types - string, number, and boolean. All primitive types are immutable. Variables are accessed via scopes according to lexical scoping rules. Scopes determine where variables can be accessed. The engine uses scopes to look up variable names during execution.
The document discusses various JavaScript concepts including ECMAScript, the difference between ES5 and ES6, web crawlers, DOM manipulation, OOPs in JavaScript, data structures like Set and Map, symbols, JavaScript engines, and recursion. ECMAScript is the standardized language specification while JavaScript is the programming language. Key differences between ES5 and ES6 include new features added in ES6 like modules and default parameters. Web crawlers systematically browse pages on the web to index content. JavaScript allows OOPs concepts like abstraction, encapsulation, inheritance and more through its prototype-based approach. Common JavaScript engines include V8, SpiderMonkey and Chakra.
JavaScript is a lightweight, interpreted programming language that runs in web browsers. It was introduced in 1995 to enable dynamic interactivity on web pages. JavaScript is used to add interactive effects and validate forms on web pages. It is an object-based scripting language that is used to make web pages dynamic. Some key features of JavaScript include being event-driven, platform independent, enabling quick development, and being relatively easy to learn. JavaScript uses variables, operators, functions, and objects to manipulate web page elements and interact with users.
The document contains the first 30 questions from a list of top 150 JavaScript interview questions. It covers topics like the differences between Java and JavaScript, data types in JavaScript, how to create arrays and objects, variable declaration keywords like var, let and const, and other fundamental concepts like functions, closures, promises and more.
The document discusses JavaScript, including its history and differences from Java. It describes JavaScript's uses in modifying HTML documents dynamically and embedding it in HTML. The document outlines JavaScript's object-based nature, primitive data types, variables, operators, and functions. It provides examples of numeric, string, and boolean literals as well as type conversions.
One of the main reasons Titanium Mobile has been so successful is that the technology has significantly lowered the barrier to entry for native mobile development. A major force behind this is JavaScript, Titanium's primary programming language. The JavaScript programming language is small enough where the basics can be learned in a matter of hours, which has enabled developers from many different backgrounds to become productive using Titanium. But there's much more to JavaScript than just control structures and a handful of primitive data types - JavaScript is a beautiful functional programming language with great features you might not be using.
Most developers working on the web today have had some exposure to JavaScript, but there's a difference between using jQuery for DOM manipulation on a web page and writing an entire application in JavaScript. This talk, intended for beginner or intermediate JavaScript developers, will focus on the essential language features you will need to write professional JavaScript applications, including but not limited to:
Object Oriented Programming in JavaScript
The Good Parts and Bad Parts of JavaScript
Useful JavaScript Patterns, Tricks, and Style Guidelines
The JavaScript runtime in Titanium Mobile
Further Reading and ways to stay up to date on JavaScript
JavaScript was originally created as LiveScript in 1995 and renamed to JavaScript. It is an interpreted scripting language that can be added to HTML pages to provide dynamic interactivity. JavaScript code is executed by the browser's JavaScript engine and does not need to be compiled. It allows manipulating the structure, style, and content of HTML documents, validating form data, detecting browser capabilities, and much more.
JavaScript and popular programming paradigms (OOP, AOP, FP, DSL). Overview of the language to see what tools we can leverage to reduce complexity of our projects.
This part goes over language features and looks at OOP and AOP with JavaScript.
The presentation was delivered at ClubAJAX on 2/2/2010.
Blog post: http://lazutkin.com/blog/2010/feb/5/exciting-js-1/
Continued in Part II: http://www.slideshare.net/elazutkin/exciting-javascript-part-ii
This document discusses object-oriented programming in JavaScript. It covers built-in objects like Object, Function, and Array. It also discusses creating custom objects using constructor functions and prototypes. Constructor functions allow initializing object state, while prototypes allow defining shared object behavior. JavaScript uses prototypal inheritance, where an object inherits directly from another object instance.
Material I prepared for a beginner's workshop on AngularJS. Feel free to change it for your own use. I would appreciate it if you attributed the original to me.
This document discusses new features in C# 4 related to dynamic coding. It describes how dynamic typing allows easier COM automation without needing interop types. Anonymous type instances can now be passed to methods using dynamic parameters. The document also discusses dynamic objects in JavaScript and how ExpandoObjects in .NET allow objects to have dynamically added and modified properties at runtime similar to dynamic objects in JavaScript.
This document provides an overview of ES6/ES2015 and best practices for JavaScript. It discusses:
- A brief history of JavaScript and how it has evolved over time with new versions like ES6.
- Key features of ES6 like let, const, arrow functions, classes, promises and how they improve upon older JavaScript.
- Tools like Babel that allow using new JavaScript features even if the runtime does not support them.
- Setting up a React Native project and development environment on Mac.
- JavaScript best practices recommended by Airbnb including style guides for functions, objects and other code structures.
- Examples of ES6 features like functions, objects and examples of how to
The document provides an overview of implementing a high-performance JavaScript engine. It discusses the key components including the parser, runtime, execution engine, garbage collector, and foreign function interface. It also covers various implementation strategies and tradeoffs for aspects like value representation, object models, execution engines, and garbage collection. The document emphasizes learning from Self VM and using techniques like hidden classes, inline caching, and tiered compilation and optimization.
Better Page Object Handling with Loadable Component Pattern - SQA Days 20, Be...Sargis Sargsyan
One of the painful problems in Selenium automated testing is determining whether a HTML page has been loaded. This is especially the case when web application uses a JS heavy framework such as the popular AngularJS.
How to handle Selenium Page Object pattern better with Loadable Component.
The Loadable Component helps test case developers make sure that the page or a component of the page is loaded successfully. I will share my experience about the concept of the Loadable Component and Page Object patterns.
Better Page Object Handling with Loadable Component PatternSQALab
This document discusses the Loadable Component pattern for improving page object handling in Selenium tests. It begins with an introduction to page object patterns and common failures. It then covers topics like wait strategies in Selenium, the LoadableComponent and SlowLoadableComponent patterns, and implementing these patterns on an existing project. Examples are provided in Java of how to update base page classes and page object classes to use these patterns. Common failures like brittle tests are also discussed.
Better Page Object Handling with Loadable Component PatternSargis Sargsyan
This document discusses using the Loadable Component pattern to improve page object handling in Selenium tests. It introduces the LoadableComponent and SlowLoadableComponent classes, which are designed to make page objects less brittle by ensuring pages are fully loaded before interacting with elements. This approach reduces boilerplate code and makes tests easier to maintain. The document also covers common failures like brittle tests, not building a framework properly, and not using explicit waits, as well as tips for continuous integration of automated tests.
JavaScript is a scripting language originally designed for web browsers but now used everywhere. It has dynamic typing and supports object-oriented, imperative, and functional programming. JavaScript was created in 1995 and standardized in 1999. It is now the most popular language on GitHub. JavaScript can be used to build interactive web pages, desktop applications, server-side applications, IoT applications, and real-time applications. The core data types in JavaScript are Number, String, Boolean, Object, Function, Array, Date, and Regular Expressions. JavaScript supports features like variables, flow control, error handling, debugging, and JSON for data exchange.
Removing Uninteresting Bytes in Software FuzzingAftab Hussain
Imagine a world where software fuzzing, the process of mutating bytes in test seeds to uncover hidden and erroneous program behaviors, becomes faster and more effective. A lot depends on the initial seeds, which can significantly dictate the trajectory of a fuzzing campaign, particularly in terms of how long it takes to uncover interesting behaviour in your code. We introduce DIAR, a technique designed to speedup fuzzing campaigns by pinpointing and eliminating those uninteresting bytes in the seeds. Picture this: instead of wasting valuable resources on meaningless mutations in large, bloated seeds, DIAR removes the unnecessary bytes, streamlining the entire process.
In this work, we equipped AFL, a popular fuzzer, with DIAR and examined two critical Linux libraries -- Libxml's xmllint, a tool for parsing xml documents, and Binutil's readelf, an essential debugging and security analysis command-line tool used to display detailed information about ELF (Executable and Linkable Format). Our preliminary results show that AFL+DIAR does not only discover new paths more quickly but also achieves higher coverage overall. This work thus showcases how starting with lean and optimized seeds can lead to faster, more comprehensive fuzzing campaigns -- and DIAR helps you find such seeds.
- These are slides of the talk given at IEEE International Conference on Software Testing Verification and Validation Workshop, ICSTW 2022.
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfMalak Abu Hammad
Discover how MongoDB Atlas and vector search technology can revolutionize your application's search capabilities. This comprehensive presentation covers:
* What is Vector Search?
* Importance and benefits of vector search
* Practical use cases across various industries
* Step-by-step implementation guide
* Live demos with code snippets
* Enhancing LLM capabilities with vector search
* Best practices and optimization strategies
Perfect for developers, AI enthusiasts, and tech leaders. Learn how to leverage MongoDB Atlas to deliver highly relevant, context-aware search results, transforming your data retrieval process. Stay ahead in tech innovation and maximize the potential of your applications.
#MongoDB #VectorSearch #AI #SemanticSearch #TechInnovation #DataScience #LLM #MachineLearning #SearchTechnology
How to Get CNIC Information System with Paksim Ga.pptxdanishmna97
Pakdata Cf is a groundbreaking system designed to streamline and facilitate access to CNIC information. This innovative platform leverages advanced technology to provide users with efficient and secure access to their CNIC details.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
UiPath Test Automation using UiPath Test Suite series, part 6DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 6. In this session, we will cover Test Automation with generative AI and Open AI.
UiPath Test Automation with generative AI and Open AI webinar offers an in-depth exploration of leveraging cutting-edge technologies for test automation within the UiPath platform. Attendees will delve into the integration of generative AI, a test automation solution, with Open AI advanced natural language processing capabilities.
Throughout the session, participants will discover how this synergy empowers testers to automate repetitive tasks, enhance testing accuracy, and expedite the software testing life cycle. Topics covered include the seamless integration process, practical use cases, and the benefits of harnessing AI-driven automation for UiPath testing initiatives. By attending this webinar, testers, and automation professionals can gain valuable insights into harnessing the power of AI to optimize their test automation workflows within the UiPath ecosystem, ultimately driving efficiency and quality in software development processes.
What will you get from this session?
1. Insights into integrating generative AI.
2. Understanding how this integration enhances test automation within the UiPath platform
3. Practical demonstrations
4. Exploration of real-world use cases illustrating the benefits of AI-driven test automation for UiPath
Topics covered:
What is generative AI
Test Automation with generative AI and Open AI.
UiPath integration with generative AI
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
For the full video of this presentation, please visit: https://www.edge-ai-vision.com/2024/06/building-and-scaling-ai-applications-with-the-nx-ai-manager-a-presentation-from-network-optix/
Robin van Emden, Senior Director of Data Science at Network Optix, presents the “Building and Scaling AI Applications with the Nx AI Manager,” tutorial at the May 2024 Embedded Vision Summit.
In this presentation, van Emden covers the basics of scaling edge AI solutions using the Nx tool kit. He emphasizes the process of developing AI models and deploying them globally. He also showcases the conversion of AI models and the creation of effective edge AI pipelines, with a focus on pre-processing, model conversion, selecting the appropriate inference engine for the target hardware and post-processing.
van Emden shows how Nx can simplify the developer’s life and facilitate a rapid transition from concept to production-ready applications.He provides valuable insights into developing scalable and efficient edge AI solutions, with a strong focus on practical implementation.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slackshyamraj55
Discover the seamless integration of RPA (Robotic Process Automation), COMPOSER, and APM with AWS IDP enhanced with Slack notifications. Explore how these technologies converge to streamline workflows, optimize performance, and ensure secure access, all while leveraging the power of AWS IDP and real-time communication via Slack notifications.
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...James Anderson
Effective Application Security in Software Delivery lifecycle using Deployment Firewall and DBOM
The modern software delivery process (or the CI/CD process) includes many tools, distributed teams, open-source code, and cloud platforms. Constant focus on speed to release software to market, along with the traditional slow and manual security checks has caused gaps in continuous security as an important piece in the software supply chain. Today organizations feel more susceptible to external and internal cyber threats due to the vast attack surface in their applications supply chain and the lack of end-to-end governance and risk management.
The software team must secure its software delivery process to avoid vulnerability and security breaches. This needs to be achieved with existing tool chains and without extensive rework of the delivery processes. This talk will present strategies and techniques for providing visibility into the true risk of the existing vulnerabilities, preventing the introduction of security issues in the software, resolving vulnerabilities in production environments quickly, and capturing the deployment bill of materials (DBOM).
Speakers:
Bob Boule
Robert Boule is a technology enthusiast with PASSION for technology and making things work along with a knack for helping others understand how things work. He comes with around 20 years of solution engineering experience in application security, software continuous delivery, and SaaS platforms. He is known for his dynamic presentations in CI/CD and application security integrated in software delivery lifecycle.
Gopinath Rebala
Gopinath Rebala is the CTO of OpsMx, where he has overall responsibility for the machine learning and data processing architectures for Secure Software Delivery. Gopi also has a strong connection with our customers, leading design and architecture for strategic implementations. Gopi is a frequent speaker and well-known leader in continuous delivery and integrating security into software delivery.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
Sudheer Mechineni, Head of Application Frameworks, Standard Chartered Bank
Discover how Standard Chartered Bank harnessed the power of Neo4j to transform complex data access challenges into a dynamic, scalable graph database solution. This keynote will cover their journey from initial adoption to deploying a fully automated, enterprise-grade causal cluster, highlighting key strategies for modelling organisational changes and ensuring robust disaster recovery. Learn how these innovations have not only enhanced Standard Chartered Bank’s data infrastructure but also positioned them as pioneers in the banking sector’s adoption of graph technology.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc
How does your privacy program stack up against your peers? What challenges are privacy teams tackling and prioritizing in 2024?
In the fifth annual Global Privacy Benchmarks Survey, we asked over 1,800 global privacy professionals and business executives to share their perspectives on the current state of privacy inside and outside of their organizations. This year’s report focused on emerging areas of importance for privacy and compliance professionals, including considerations and implications of Artificial Intelligence (AI) technologies, building brand trust, and different approaches for achieving higher privacy competence scores.
See how organizational priorities and strategic approaches to data security and privacy are evolving around the globe.
This webinar will review:
- The top 10 privacy insights from the fifth annual Global Privacy Benchmarks Survey
- The top challenges for privacy leaders, practitioners, and organizations in 2024
- Key themes to consider in developing and maintaining your privacy program
1. JavaScript OMG!
An introduction to the unusual
and unexpected features of
JavaScript.
Bart.Wullems@ordina.be http://bartwullems.blogspot.com
www.visug.be
2. Introduction
• JavaScript(originally LiveScript) was
developed by Brendan Eich of Netscape.
• He achieved this in a 6 weeks period…
• …for some parts he did an amazing job
• …for other parts it was…euhm… „less
amazing‟
• EcmaScript 5 tries to solve most of the
problems that JavaScript has today(and
jQuery helps too…)
www.visug.be
4. OMG #1 – Optional Semicolons
• Interpreter can try to figure out the end of
statements
• WARNING: some dangerous edge cases
exist!
– E.g. Return keyword
www.visug.be
5. OMG #2 – Type System
• JavaScript types are primitive types or
object types.
• Primitive types are Number, Boolean and
String
• Number is a 64-bit floating point value
– Challenge in building scientific/financial
applications
– No .NET‟s Decimal type to help out.
• There‟s also two other values null and
undefined which are both values and types
www.visug.be
6. OMG #2 – Type System
• TypeOf
– Returns the type of an instance of a fundamental
type.
– If it is not a fundamental type, typeof will return
„Object‟:
• InstanceOf
– Returns whether the object was constructed
using the specified constructor.
– Useful when attempting to check the type of one
of your own defined object types.
– Misleading if you create an instance of one of the
built-in types using literal syntax.
www.visug.be
7. OMG #3 –
Underflow, Overflow, Div by Zero
• Divide by zero does not throw any kind of
error or exception
• Divide by zero returns an infinite value
• Divide zero by zero returns NaN
• 2 helpful functions:
– isNan()
– isFinite()
www.visug.be
8. OMG #4 – Regular Expressions
• JavaScript has built in support for regular
expressions
www.visug.be
9. OMG #5 – Truthy and Falsy
• Everything is true unless it‟s:
– Undefined, null, 0, -0, NaN, “”
• Can get tricky when converting from one
type to another
www.visug.be
10. OMG #6 – The Global Object
• There IS a Global Object.
• Defining global variables and global
functions means mutating the global
object.
www.visug.be
11. OMG #7 – Expando Objects
• JavaScript has the very powerful/scary
system which allows you to just expand
objects with new properties
– (unless those objects have been marked to
disallow it)
• Reminder: Everything is an object!
www.visug.be
12. OMG #8 – Wrappers
• Wrapper objects = process of “boxing” in
.NET.
• Treat primitive types not as objects to
increase performance, use it as an object
only when needed
• In JavaScript, this seems to called
“Wrapper Objects” and it allows to treat a
primitive like an object.
www.visug.be
13. OMG #9 – Type Conversions
• JavaScript has a pretty complex list of type
conversions.
• Most of them are pretty intuitive.
www.visug.be
14. OMG #10 – Object to Primitive
Conversions
• Objects convert to booleans very naturally by
converting to true for every value that‟s not
null or undefined.
• Converting objects to strings goes via
toString() and then if that isn‟t appropriate
(i.e. doesn‟t give some primitive value that
can be converted to a string or doesn‟t exist)
then it goes via valueOf() to try and get to
some primitive value.
www.visug.be
15. OMG #11 – Variable scope and
hoisting
• JavaScript has function scope instead of
block scope.
• JavaScript will move all variable
declarations to the beginning of the
function scope.
www.visug.be
16. OMG #12 – Bitwise Operators
• The bitwise operators in the language
behave as though they are working on 32-
bit integers rather than as though they
were working on 64-bit floating point
values.
www.visug.be
17. OMG #13 – Equality and Strict
Equality
• There are 2 ways to check equality in
JavaScript. There‟s the regular “==” and
then there‟s the “===”
• Use === or the “strict equality operator”
– Comes with no surprises;
www.visug.be
18. OMG #14 – Use Strict
• Start using the “use strict” directive
brought in for ECMAScript5
• Brings a long list of changes to the
language (e.g. “all variables must be
declared”, “it is a syntax error for a
function declaration to have two or more
parameters with the same name”) and so
on.
• Windows 8 supports it already
www.visug.be
19. OMG #15 – Magic of Short-
Circuiting ANDs and Truthy/Falsy
• In a language like C# it can be quite
painful to index into a complex object
model while all the time trying to protect
yourself from the pains of a null reference
exception.
• The magic of the AND operator returning
the right value at the right time makes this
a lot easier in JavaScript.
www.visug.be
20. OMG #16 – Function arguments
• JavaScript functions allow for very flexible
argument usage (way beyond optional and
named arguments).
www.visug.be
21. OMG #17 – Nested functions
• Define functions inside of functions
and, optionally, form closures over the
local variable state.
www.visug.be
22. OMG #18 – Arrays vs Lists
• JavaScript Arrays feel more like .NET‟s
ArrayList in many ways.
– You can just add things to an array whenever
and wherever you feel like it;
www.visug.be
23. OMG #19 – Function Invocation
Context
• If writing a plain old, vanilla function then
the this pointer is set to the global object.
• ES5 strict mode comes along and try to
tidy this up.
www.visug.be
24. OMG #20 – Nested functions and
invocation context
• If I have a nested function inside a
method then even it picks up the global
object for its invocation context unless I‟m
in strict mode when it throws an error.
• Pick up the this pointer yourself such that
the nested function captures it.
www.visug.be
25. OMG #21 – Everything‟s a Function
• JavaScript allows the basic types of the
language to be augmented.
• Adding a method to Object.prototype makes
that method available to all objects.
• This also works for
functions, arrays, strings, numbers, regular
expressions, and booleans.
• For example, by augmenting
Function.prototype, we can make a method
available to all functions.
www.visug.be
26. OMG #22 – array.sort() won‟t sort
numbers “correctly”
• The sort method sorts the contents of an array in
place. It sorts arrays of numbers incorrectly.
• JavaScript‟s default comparison function assumes
that the elements to be sorted are strings.
• Fortunately, you may replace the comparison
function with your own.
– Your comparison function should take two parameters
and return 0 if the two parameters are equal, a
negative number if the first parameter should come
first, and a positive number if the second parameter
should come first.
www.visug.be
27. OMG #23 – parseInt() needs help
• parseInt is a function that converts a string
into an integer.
• It stops when it sees a nondigit, so
parseInt("16") and parseInt("16 tons")
produce the same result.
• If the first character of the string is 0, then
the string is evaluated in base 8 instead of
base 10. times.
• parseInt can take a radix
parameter, recommendation to always
provide it www.visug.be
28. OMG #24 – Callbacks and Scope
• Callbacks and scope are not completely
similar to C#
• Callbacks needs a pointer to the instance
object(not required in C#)
www.visug.be
29. OMG #25 – ADVANCED: Function
Literals Create Functions
• Functions are created for every instance of
an object
– Unless the function is defined on the
prototype object
www.visug.be
30. OMG #26 – ADVANCED: Partial
Application & Mapping
• What if we need a function where one of
the operator‟s arguments is already given?
• For cases like that, something called
partial application is useful.
• We want to take a function X and one or
more arguments and then create a new
function that calls X with both the original
arguments and any newly passed ones.
• Very usefull in map-reduce context
www.visug.be
31. OMG #27 – ADVANCED: “Self
Defining” Functions
• If you create a new function and assign it to
the same variable that already holds another
function, you‟re overwriting the old function.
• If you do this inside the body of the old
function, the function overwrites and
redefines itself
• Useful when your function has some initial
peparatory work to do and it needs to do it
only once. The self-defining function can
update its own implementation.
www.visug.be
32. OMG #28 – ADVANCED: This or
That?
• Same rules as for functions in OMG #24
apply to events
www.visug.be
33. OMG #29 – String replace
• .replace method on strings replaces by
default only the first match
• To replace all matches, you must use a
Regular Expression and add the global
modifier
www.visug.be
34. OMG #30 – The + operator
• In JavaScript + always results in
concatenation when either of the
operands is a string.
• This might catch you out if you're trying to
add a number to, say, the contents of an
input element (which will be a string), so
you need to first cast to Number.
www.visug.be
35. OMG #31 – The new keyword
• JavaScript has the types Object, Array, Boolean, Number, String, and
Function.
– The explicit constructor is never required.
– If you use the new keyword to construct one of these types, what you
actually get is an object of type Object that inherits the prototype of the
type you want to construct (the exception is Function).
– Always use the literal syntax constructing one of these types to avoid
any confusion.
• If you write your own constructor function and forget to include the
new keyword, then bad things happen:
– Calling a function with the new keyword creates a new object and then
calls the function with that new object as its context. The object is then
returned.
– Calling a function without 'new' will result in the context being the
global object if that function is not invoked on an object (which it won't
be anyway if it's used as a constructor!)
www.visug.be
36. OMG #32 – There is no integer
• Numerical calculations are comparatively
slow because there is no Integer
type, only Number
• Number is an IEEE floating point double-
precision (64 bit) type.
• This exhibits some floating point rounding
errors.
www.visug.be
37. OMG #33 – NaN
• The type of NaN (Not a Number) is...
Number.
• NaN compared to anything is false.
• The only way to test whether a number is
equal to NaN is with the helper function
isNaN().
www.visug.be
38. OMG #34 – The arguments object
• Within a function, you can reference the
arguments object to retrieve the list of arguments.
– This object is not an Array but an array-like object.
– Use the array splice function to create an array from
the properties in arguments:
• When a function has explicit arguments in its
signature, they can be reassigned and the
arguments object will also be changed.
– You can't rely on arguments to give you their original
values.
– In ES5 strict mode, arguments will always point to the
original input argument values, as opposed to their
current values.
www.visug.be
40. Resources
• Mike Taulty Javascript OMG!
• A Collection of JavaScript Gotchas
• WTF JS
• A survey of the JavaScript programming
language
www.visug.be