This document provides examples and explanations of various JavaScript and TypeScript features including:
- Template literals and string interpolation
- let and const variable declarations
- Property shorthand syntax
- Object destructuring
- Spread operators
- Arrow functions
- Optional chaining
- Named exports and imports in ES modules
- Default exports in ES modules
- Fetching data with fetch API and promises
- Using the Axios library for HTTP requests
- Async/await syntax
- Mapping, filtering, and finding array elements
- Immutability with object and array methods
- Primitive and complex data types in TypeScript like interfaces, enums, and type aliases
This document summarizes JavaScript features such as template strings, let/const, property shorthand, computed property names, destructuring, spread operators, arrow functions, modules, map, filter, find, and findIndex. It provides code examples for each feature to demonstrate their usage.
This document provides examples and explanations of various TypeScript features including:
- Primitive data types like string, number, boolean
- Array, interface, and type alias syntax
- Function types and generics
- Union, intersection, and conditional types
- Generic constraints and type inference
- Built-in utility types like Pick, Partial, and Required
It demonstrates how to define types for functions, parameters, and return values. The examples show how to create custom generic types and conditional types as well as how to leverage built-in utility types. Overall the document serves as a recap of key TypeScript concepts.
The document summarizes TypeScript types including primitive data types, interfaces, functions, generics, and utility types. It shows examples of defining types for variables, parameters, return values, and objects. Key types demonstrated include string, number, boolean, any, unknown, arrays, tuples, literal types, union types, and type aliases.
He will start you at the beginning and cover prerequisites; setting up your development environment first. Afterward, you will use npm to install react-native-cli. The CLI is our go to tool. We use it to create and deploy our app.
Next, you will explore the code. React Native will look familiar to all React developers since it is React. The main difference between React on the browser and a mobile device is the lack of a DOM. We take a look a many of the different UI components that are available.
With React Native you have access to all of the devices hardware features like cameras, GPS, fingerprint reader and more. So we'll show some JavaScript code samples demonstrating it. We will wrap up the evening by deploying our app to both iOS and Android devices and with tips on getting ready for both devices stores.
This document provides an overview of ES6 features and how to set them up for use in Ruby on Rails applications. It describes key ES6 features such as let and const block scoping, template strings, destructuring assignment, default and rest parameters, loops and generators, enhanced object literals, Maps and Sets, arrow functions, modules, and classes. It then provides instructions for using the sprockets-es6 gem to transpile ES6 code to ES5 for use in Rails, as well as using Node.js and Gulp as an alternative approach.
Game Design and Development Workshop Day 1Troy Miles
This course teaches you how to build awesome video games using Cocos2Dx. Cocos2Dx is a feature packed, free game development engine. It is cross platform, high performance, and supports three languages: C++, Lua and JavaScript. With it, you can write games for iOS, Android, Windows, Mac, and the Web. It is nothing short of amazing and this course teaches you how to use it. We will program Cocos2Dx in JavaScript, but this is not a programming class. If you don't know how to write code in JavaScript or some other curly brace language, this is not the course for you. For those whose JavaScript is rusty, we will do quick language overview. Don't let the JavaScript part fool you. Cocos2Dx is built from highly optimized C++ and OpenGL, JavaScript is used for game logic, not graphics. Our games will run at a super fast, 60 frames a second.
This document summarizes JavaScript features such as template strings, let/const, property shorthand, computed property names, destructuring, spread operators, arrow functions, modules, map, filter, find, and findIndex. It provides code examples for each feature to demonstrate their usage.
This document provides examples and explanations of various TypeScript features including:
- Primitive data types like string, number, boolean
- Array, interface, and type alias syntax
- Function types and generics
- Union, intersection, and conditional types
- Generic constraints and type inference
- Built-in utility types like Pick, Partial, and Required
It demonstrates how to define types for functions, parameters, and return values. The examples show how to create custom generic types and conditional types as well as how to leverage built-in utility types. Overall the document serves as a recap of key TypeScript concepts.
The document summarizes TypeScript types including primitive data types, interfaces, functions, generics, and utility types. It shows examples of defining types for variables, parameters, return values, and objects. Key types demonstrated include string, number, boolean, any, unknown, arrays, tuples, literal types, union types, and type aliases.
He will start you at the beginning and cover prerequisites; setting up your development environment first. Afterward, you will use npm to install react-native-cli. The CLI is our go to tool. We use it to create and deploy our app.
Next, you will explore the code. React Native will look familiar to all React developers since it is React. The main difference between React on the browser and a mobile device is the lack of a DOM. We take a look a many of the different UI components that are available.
With React Native you have access to all of the devices hardware features like cameras, GPS, fingerprint reader and more. So we'll show some JavaScript code samples demonstrating it. We will wrap up the evening by deploying our app to both iOS and Android devices and with tips on getting ready for both devices stores.
This document provides an overview of ES6 features and how to set them up for use in Ruby on Rails applications. It describes key ES6 features such as let and const block scoping, template strings, destructuring assignment, default and rest parameters, loops and generators, enhanced object literals, Maps and Sets, arrow functions, modules, and classes. It then provides instructions for using the sprockets-es6 gem to transpile ES6 code to ES5 for use in Rails, as well as using Node.js and Gulp as an alternative approach.
Game Design and Development Workshop Day 1Troy Miles
This course teaches you how to build awesome video games using Cocos2Dx. Cocos2Dx is a feature packed, free game development engine. It is cross platform, high performance, and supports three languages: C++, Lua and JavaScript. With it, you can write games for iOS, Android, Windows, Mac, and the Web. It is nothing short of amazing and this course teaches you how to use it. We will program Cocos2Dx in JavaScript, but this is not a programming class. If you don't know how to write code in JavaScript or some other curly brace language, this is not the course for you. For those whose JavaScript is rusty, we will do quick language overview. Don't let the JavaScript part fool you. Cocos2Dx is built from highly optimized C++ and OpenGL, JavaScript is used for game logic, not graphics. Our games will run at a super fast, 60 frames a second.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
The document provides instructions for setting up Cypress, TypeScript, ESLint, and Prettier for testing a React application. It includes steps to initialize npm, install dependencies, configure TypeScript and linting rules. It also covers how to add custom Cypress commands, mock network requests, generate fake data with Faker, and select elements based on their ARIA role.
Groovy is a dynamic language for the Java platform that provides features inspired by languages like Python, Ruby and Smalltalk. It allows Java developers to use these features with a syntax that is very similar to Java. Groovy code can be compiled to Java bytecode and integrated with Java applications and libraries. It supports features like closures, metaprogramming, builders and templates to improve developer productivity.
The document discusses ECMAScript 6 (ES6), a major update to JavaScript. It describes new features added in five acts, including modules, syntax enhancements, classes, functions improvements, and tools for compiling ES6 to older JavaScript versions. Key additions are modules, classes, arrow functions, let/const variables, template literals, and promises to support asynchronous programming. Compilers like Babel allow using ES6 features while targeting older JavaScript environments.
Ember.js is a JavaScript framework for building web applications. It provides conventions and architecture to make applications more organized and testable. Key aspects of Ember.js include Ember objects, computed properties, templates powered by Handlebars, routes for navigation, and a data modeling layer using Ember Data. Components are also used to build reusable isolated views. Ember follows a "data down, actions up" pattern where data flows from parent to child components and user actions bubble up through the components.
The document provides an overview of MongoDB including key concepts like collections, documents, queries, indexes, aggregation, and more. It compares MongoDB to a traditional SQL database and shows examples of common operations like insert, update, find in MongoDB shell and Node.js driver. It also briefly covers more advanced topics like geospatial queries, optimization, replication and sharding.
ave time learning on your own. Start Building with React, MongoDB, Express, & Node. The MERN Stack.
Learning a new JavaScript framework is difficult. You can spend weeks learning new concepts. If an online example doesn’t work, you may spend countless hours Googling, searching Stack Overflow and blogs for the solution.
Take the fast track and learn from an experienced Senior Software Engineer and professional instructor!
About this Course
This highly interactive course features a large amount of student labs and hands-on coding. You will be taught how to assemble the complete stack required to build a modern web app using React.js, MongoDB (a NoSQL database) and Express (a framework for web application servers). This course will also cover many other tools that go into building a complete web application: React Router, React-Bootstrap, Redux, Babel, and Webpack.
What You Will Learn
• How to use modern JavaScript features
• Webpack
• Node & Express
• Reading and writing data to a MongoDB database
• Babel
• React
• State Management with Redux
• Mongoose
• And More!
The document provides an overview of key JavaScript concepts including variables, data types, operators, control flow, functions, objects, and arrays. It explains that JavaScript is used for both client-side scripting in web browsers and server-side scripting with Node.js. Key topics covered include primitive data types, operators, if/else and switch statements, loops, functions, objects, methods, and arrays. The document also discusses JavaScript fundamentals like variables, scoping, and hoisting as well as more advanced topics like recursion, symbols, and memory management.
This full day course will give you a hands-on, deep dive into React Native. In this course, you will learn how to build cross-platform mobile applications from scratch using Facebook's React Native.
Updated version of talk "Javascript the New Parts".
I gave this at JsDay on May 12th 2011.
I updated with latest stats and improved es5 coverage, most notably strict mode.
Abstract:
At last, ecmascript 5th edition is landing in all modern browsers. What are the new parts of the language and how can they help us to write better code?
Also
http://federico.galassi.net/
http://www.jsday.it/
Follow me on Twitter!
https://twitter.com/federicogalassi
The document provides an agenda for a talk on modeling a Rubik's Cube in JavaScript. It begins with an introduction to scripting languages and ECMAScript. It then discusses modeling a Rubik's Cube by first walking through the code, then modeling the cube and finding moves to solve it. The document covers topics like scripting languages, ECMAScript, object-oriented programming concepts in JavaScript, and modeling a Rubik's Cube to be manipulated programmatically.
The document defines a LineChart class that extends the Chart class. The LineChart class constructor calls the parent constructor and draws the chart. The draw method builds a line chart from the series data using an SVG library, appends it to the canvas, and adds statistics for each data point by calling the parent addStats method. The getSerieData static method calculates max and average values for a data series. The class is exported for use in other code.
This document discusses new features coming to JavaScript in ECMAScript 6, including:
1) Block scope keywords "let" and "const" that allow for block-level scoping of variables.
2) Shorthand syntax for object literals and method definitions.
3) Destructuring assignments for extracting values from objects and arrays.
4) Default parameter values, rest parameters, and spread syntax for working with functions and arrays.
5) New features like modules, classes, and imports for better organizing code.
The document summarizes 10 new features in ECMAScript 2015 (ES6):
1. Default parameters allow defining function parameters that can be omitted when calling a function.
2. Rest parameters collect multiple function arguments into an array.
3. Spread syntax expands iterables like arrays into individual arguments.
4. Let and const introduce block scope and prevent redeclaration of variables.
5. Classes provide syntactic sugar over prototype-based inheritance.
6. Enhanced object literals allow omitting repeated name/value pairs and adding methods.
7. Template literals allow multiline strings and embedded expressions.
8. Object.assign copies enumerable own properties from one or more source objects to a target
The document provides code examples and explanations for various JavaScript programming techniques. Some examples covered include:
1. Using logical operators and default parameters to handle function arguments concisely.
2. Different methods for converting strings to numbers, setting default object properties, and checking if an object property exists.
3. Techniques for improving loop performance by caching array lengths and merging arrays without creating new objects.
4. Examples of array slicing and truncation, as well as converting array-like objects to arrays.
5. Explanations of equality comparisons, typeof, instanceof, and immediately invoked function expressions.
JavaScript Objects and OOP Programming with JavaScriptLaurence Svekis ✔
Get this Course
https://www.udemy.com/javascript-objects-oop/?couponCode=SLIDESHARE
Use objects to create amazing things with JavaScript power up your applications OOP JavaScript coding
The document summarizes Dmitry Soshnikov's presentation on ECMAScript 6 features at the HelsinkiJS meetup on December 12, 2011. Key features discussed include default function parameters, modules system, quasi-literals for string templates, array comprehensions, maps and weak maps, destructuring assignment, rest operator for function arguments, proxy objects for meta programming, and struct types.
ES6 is Nigh is a presentation on the future of JavaScript. It discusses the history of JavaScript and why ES6 is important for advancing the language. The presentation outlines many new features being added in ES6, such as arrow functions, classes, modules, template strings, symbols, generators, and proxies. It emphasizes that ES6 is purely additive and introduces these features without breaking backwards compatibility.
The fundamentals and advance application of Node will be covered. We will explore the design choices that make Node.js unique, how this changes the way applications are built and how systems of applications work most effectively in this model. You will learn how to create modular code that’s robust, expressive and clear. Understand when to use callbacks, event emitters and streams.
The document provides instructions for setting up Cypress, TypeScript, ESLint, and Prettier for testing a React application. It includes steps to initialize npm, install dependencies, configure TypeScript and linting rules. It also covers how to add custom Cypress commands, mock network requests, generate fake data with Faker, and select elements based on their ARIA role.
Groovy is a dynamic language for the Java platform that provides features inspired by languages like Python, Ruby and Smalltalk. It allows Java developers to use these features with a syntax that is very similar to Java. Groovy code can be compiled to Java bytecode and integrated with Java applications and libraries. It supports features like closures, metaprogramming, builders and templates to improve developer productivity.
The document discusses ECMAScript 6 (ES6), a major update to JavaScript. It describes new features added in five acts, including modules, syntax enhancements, classes, functions improvements, and tools for compiling ES6 to older JavaScript versions. Key additions are modules, classes, arrow functions, let/const variables, template literals, and promises to support asynchronous programming. Compilers like Babel allow using ES6 features while targeting older JavaScript environments.
Ember.js is a JavaScript framework for building web applications. It provides conventions and architecture to make applications more organized and testable. Key aspects of Ember.js include Ember objects, computed properties, templates powered by Handlebars, routes for navigation, and a data modeling layer using Ember Data. Components are also used to build reusable isolated views. Ember follows a "data down, actions up" pattern where data flows from parent to child components and user actions bubble up through the components.
The document provides an overview of MongoDB including key concepts like collections, documents, queries, indexes, aggregation, and more. It compares MongoDB to a traditional SQL database and shows examples of common operations like insert, update, find in MongoDB shell and Node.js driver. It also briefly covers more advanced topics like geospatial queries, optimization, replication and sharding.
ave time learning on your own. Start Building with React, MongoDB, Express, & Node. The MERN Stack.
Learning a new JavaScript framework is difficult. You can spend weeks learning new concepts. If an online example doesn’t work, you may spend countless hours Googling, searching Stack Overflow and blogs for the solution.
Take the fast track and learn from an experienced Senior Software Engineer and professional instructor!
About this Course
This highly interactive course features a large amount of student labs and hands-on coding. You will be taught how to assemble the complete stack required to build a modern web app using React.js, MongoDB (a NoSQL database) and Express (a framework for web application servers). This course will also cover many other tools that go into building a complete web application: React Router, React-Bootstrap, Redux, Babel, and Webpack.
What You Will Learn
• How to use modern JavaScript features
• Webpack
• Node & Express
• Reading and writing data to a MongoDB database
• Babel
• React
• State Management with Redux
• Mongoose
• And More!
The document provides an overview of key JavaScript concepts including variables, data types, operators, control flow, functions, objects, and arrays. It explains that JavaScript is used for both client-side scripting in web browsers and server-side scripting with Node.js. Key topics covered include primitive data types, operators, if/else and switch statements, loops, functions, objects, methods, and arrays. The document also discusses JavaScript fundamentals like variables, scoping, and hoisting as well as more advanced topics like recursion, symbols, and memory management.
This full day course will give you a hands-on, deep dive into React Native. In this course, you will learn how to build cross-platform mobile applications from scratch using Facebook's React Native.
Updated version of talk "Javascript the New Parts".
I gave this at JsDay on May 12th 2011.
I updated with latest stats and improved es5 coverage, most notably strict mode.
Abstract:
At last, ecmascript 5th edition is landing in all modern browsers. What are the new parts of the language and how can they help us to write better code?
Also
http://federico.galassi.net/
http://www.jsday.it/
Follow me on Twitter!
https://twitter.com/federicogalassi
The document provides an agenda for a talk on modeling a Rubik's Cube in JavaScript. It begins with an introduction to scripting languages and ECMAScript. It then discusses modeling a Rubik's Cube by first walking through the code, then modeling the cube and finding moves to solve it. The document covers topics like scripting languages, ECMAScript, object-oriented programming concepts in JavaScript, and modeling a Rubik's Cube to be manipulated programmatically.
The document defines a LineChart class that extends the Chart class. The LineChart class constructor calls the parent constructor and draws the chart. The draw method builds a line chart from the series data using an SVG library, appends it to the canvas, and adds statistics for each data point by calling the parent addStats method. The getSerieData static method calculates max and average values for a data series. The class is exported for use in other code.
This document discusses new features coming to JavaScript in ECMAScript 6, including:
1) Block scope keywords "let" and "const" that allow for block-level scoping of variables.
2) Shorthand syntax for object literals and method definitions.
3) Destructuring assignments for extracting values from objects and arrays.
4) Default parameter values, rest parameters, and spread syntax for working with functions and arrays.
5) New features like modules, classes, and imports for better organizing code.
The document summarizes 10 new features in ECMAScript 2015 (ES6):
1. Default parameters allow defining function parameters that can be omitted when calling a function.
2. Rest parameters collect multiple function arguments into an array.
3. Spread syntax expands iterables like arrays into individual arguments.
4. Let and const introduce block scope and prevent redeclaration of variables.
5. Classes provide syntactic sugar over prototype-based inheritance.
6. Enhanced object literals allow omitting repeated name/value pairs and adding methods.
7. Template literals allow multiline strings and embedded expressions.
8. Object.assign copies enumerable own properties from one or more source objects to a target
The document provides code examples and explanations for various JavaScript programming techniques. Some examples covered include:
1. Using logical operators and default parameters to handle function arguments concisely.
2. Different methods for converting strings to numbers, setting default object properties, and checking if an object property exists.
3. Techniques for improving loop performance by caching array lengths and merging arrays without creating new objects.
4. Examples of array slicing and truncation, as well as converting array-like objects to arrays.
5. Explanations of equality comparisons, typeof, instanceof, and immediately invoked function expressions.
JavaScript Objects and OOP Programming with JavaScriptLaurence Svekis ✔
Get this Course
https://www.udemy.com/javascript-objects-oop/?couponCode=SLIDESHARE
Use objects to create amazing things with JavaScript power up your applications OOP JavaScript coding
The document summarizes Dmitry Soshnikov's presentation on ECMAScript 6 features at the HelsinkiJS meetup on December 12, 2011. Key features discussed include default function parameters, modules system, quasi-literals for string templates, array comprehensions, maps and weak maps, destructuring assignment, rest operator for function arguments, proxy objects for meta programming, and struct types.
ES6 is Nigh is a presentation on the future of JavaScript. It discusses the history of JavaScript and why ES6 is important for advancing the language. The presentation outlines many new features being added in ES6, such as arrow functions, classes, modules, template strings, symbols, generators, and proxies. It emphasizes that ES6 is purely additive and introduces these features without breaking backwards compatibility.
9 logging and monitoring.pdf 9 logging and monitoring.pdfNuttavutThongjor1
Babel Coder is a tool that provides access to the Elastic Stack and Grafana. It mentions Babel Coder and its integration with the Elastic Stack and Grafana in a repetitive manner without providing many details about the product, its features, or benefits.
The document discusses Kubernetes concepts including pods, deployments, services, and configmaps. It shows examples of running pods and deployments. It also demonstrates different service types like ClusterIP, NodePort, and LoadBalancer and how to access applications using services. Finally, it provides an example of creating a configmap from a file and referencing it in a deployment.
This document provides an overview of Angular fundamentals including components, directives, pipes, services, and reactive programming concepts. It defines components as reusable UI building blocks that control a view. It demonstrates core directives like NgFor, NgIf, and NgSwitch. It also covers lifecycle hooks, built-in and custom pipes, dependency injection with services, RxJS observables, and reactive programming concepts like streams and operators.
The document discusses different approaches to organizing code for a MEAN stack application, including using multiple repositories, a monorepository, or an NX workspace. It also covers component-based and feature-based approaches to code organization, with the component-based approach grouping related UI components together and the feature-based approach grouping code for an feature together, such as all code related to retrieving articles from an API.
This document discusses state management tools for JavaScript applications. It mentions Babel Coder, PINIA, and multiple stores for state including store, store, store, ui, user, and conf.
This document discusses different rendering modes for Babel Coder including client-side rendering, server-side rendering, and prerendering. It mentions APIs for client-side and server-side rendering and examples of URLs and files involved in prerendering and the stale-while-revalidate approach.
Babel Coder is a state management tool that allows developers to manage application state in a single centralized store or multiple separate stores. It provides options for storing state data in a single store using slices or in multiple separate stores for different parts of the application. The stores can contain data for the UI, user, and configuration.
This document summarizes key concepts for building applications with Nuxt, including:
- Using layouts to create common page wrappers and named layouts
- Setting up page-level routing and route rules for redirection
- Linking between routes using <NuxtLink> and accessing route information with useRouter and useRoute
- Passing parameters, queries, and programmatically navigating routes
The document describes the development of Vue components for displaying article data. It shows how a data table component is created to accept article data and columns via props, and emit events on row clicks. Default values are added for optional props. Slots are added to allow custom header, footer and default content. Fallback content is provided for empty slots.
The document provides examples and explanations of various Vue reactivity concepts including ref, reactive, computed properties, lifecycle hooks, watch, watchEffect, composables, and template refs. Key points covered include updating reactivity, shallow reactivity, losing reactivity when destructuring objects, and automatically tracking dependencies with watchEffect.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...Levi Shapiro
Letter from the Congress of the United States regarding Anti-Semitism sent June 3rd to MIT President Sally Kornbluth, MIT Corp Chair, Mark Gorenberg
Dear Dr. Kornbluth and Mr. Gorenberg,
The US House of Representatives is deeply concerned by ongoing and pervasive acts of antisemitic
harassment and intimidation at the Massachusetts Institute of Technology (MIT). Failing to act decisively to ensure a safe learning environment for all students would be a grave dereliction of your responsibilities as President of MIT and Chair of the MIT Corporation.
This Congress will not stand idly by and allow an environment hostile to Jewish students to persist. The House believes that your institution is in violation of Title VI of the Civil Rights Act, and the inability or
unwillingness to rectify this violation through action requires accountability.
Postsecondary education is a unique opportunity for students to learn and have their ideas and beliefs challenged. However, universities receiving hundreds of millions of federal funds annually have denied
students that opportunity and have been hijacked to become venues for the promotion of terrorism, antisemitic harassment and intimidation, unlawful encampments, and in some cases, assaults and riots.
The House of Representatives will not countenance the use of federal funds to indoctrinate students into hateful, antisemitic, anti-American supporters of terrorism. Investigations into campus antisemitism by the Committee on Education and the Workforce and the Committee on Ways and Means have been expanded into a Congress-wide probe across all relevant jurisdictions to address this national crisis. The undersigned Committees will conduct oversight into the use of federal funds at MIT and its learning environment under authorities granted to each Committee.
• The Committee on Education and the Workforce has been investigating your institution since December 7, 2023. The Committee has broad jurisdiction over postsecondary education, including its compliance with Title VI of the Civil Rights Act, campus safety concerns over disruptions to the learning environment, and the awarding of federal student aid under the Higher Education Act.
• The Committee on Oversight and Accountability is investigating the sources of funding and other support flowing to groups espousing pro-Hamas propaganda and engaged in antisemitic harassment and intimidation of students. The Committee on Oversight and Accountability is the principal oversight committee of the US House of Representatives and has broad authority to investigate “any matter” at “any time” under House Rule X.
• The Committee on Ways and Means has been investigating several universities since November 15, 2023, when the Committee held a hearing entitled From Ivory Towers to Dark Corners: Investigating the Nexus Between Antisemitism, Tax-Exempt Universities, and Terror Financing. The Committee followed the hearing with letters to those institutions on January 10, 202
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
2. Babel Coder
TEMPLATE
Template String
var myStr1 = 'Hello World'
var myStr2 = "Hello World"
var myStr3 = "HellonWorld"
var myStr4 = `
Lorem ipsum dolor sit amet,
consectetur adipiscing elit,
sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.
`
var myStr5 = `${myStr1} Krub`
3. Babel Coder
LET AND CONST
function foo() {
let x = 1
x = 2
}
foo()
function foo() {
const x = 1
x = 2
}
foo()
5. Babel Coder
DESTRUCTURING
let person = {
age: 24,
gender: 'male',
name: {
fi
rstName: '
fi
rstName',
lastName: 'lastName'
}
}
let age = person.age
let gender = person.gender
let name = person.name
let
fi
rstName = name.
fi
rstName
let lastName = name.lastName
let { age, gender, name } = person
let {
fi
rstName, lastName } = name
let { age, gender, name: {
fi
rstName, lastName } } = person
8. Babel Coder
ARROW FUNCTION
function foo(a) {
return a + 1
}
const foo = (a) => {
return a + 1
}
const foo = a => {
return a + 1
}
const foo = a => a + 1
const foo = a => let b = a + 1 Must be expression
10. ES MODULE - NAMED EXPORTS
export const DEFAULT_COLOR = 'white'
export function walk() {
console.log('Walking...')
}
{
DEFAULT_COLOR: 'white',
walk() {
console.log('Walking...')
}
}
dog.js
main.js
syntax: 1
import * as lib from './dog.js'
lib.DEFAULT_COLOR // white
lib.walk() // Walking...
main.js
syntax: 2
import { DEFAULT_COLOR, walk } from './dog.js'
11. ES MODULE - DEFAULT EXPORT
circle.js
main.js
syntax
export default class Circle {
area() {
}
}
import Circle from './circle.js'
12. ES MODULE - BOTH
circle.js
export const PI = 3.14
export default class Circle {
area() {
}
}
main.js
syntax
import Circle, { PI } from './circle.js'
17. EXAMPLE 1
Fetch content from URL: https://jsonplaceholder.typicode.com/todos
import axios from 'axios'
async function fetchPosts() {
const res =await axios.get(URL)
console.log(res.data)
console.log(res.status) // 200
}
fetchPosts()
HTTP GET HTTP POST
import axios from 'axios'
async function createPost() {
const res =await axios.post(
URL, { title: 'Test', completed: true })
console.log(res.status) // 201
}
createPost()
18. WHAT IS FUNCTIONAL PROGRAMMING
• Functional Programming is a programming paradigm.
• It treats computation as the evaluation of mathematical functions.
• Avoid changing state.
• Eliminating side effects of function calls.
• Declarative Style
30. Babel Coder
ANY AND UNKNOWN
function next(num: number) {
return num + 1;
}
let num: any = 10;
num = 'hello';
next(num);
num.toFixed(2);
let num: unknown = 10;
num = 'hello';
// Argument of type 'unknown' is not assignable to parameter of type 'number'.
next(num);
// Object is of type 'unknown'.
num.toFixed(2);
const num: unknown = 10;
next(num);
if (typeof num === 'number') {
next(num);
}
31. Babel Coder
LITERAL TYPES
let str1: 'Hello' = 'Hello';
let str2: string = str1;
// Type 'string' is not assignable to type '"Hello"'.
str1 = str2;
let str1 = 'Hello'; // string
const str2 = 'Hello'; // Hello
function permission(role: 'Admin' | 'Moderator' | 'Editor') {
// do sth
}
permission('Admin');
let role = 'Editor';
// Argument of type 'string' is not assignable
// to parameter of type '"Admin" | "Moderator" | "Editor"'.
permission(role);
permission(role as 'Editor');
32. Babel Coder
ARRAY
let nums1: number[] = [1, 2, 3] // number[]
let nums2: Array<number> = [1, 2, 3] // number[]
let nums3 = [1, 2, 3] // number[]
const nums4 = [1, 2, 3] // number[]
const nums5: readonly number[] = [1, 2, 3] // readonly number[]
const nums6: ReadonlyArray<number> = [1, 2, 3] // readonly number[]
const nums7 = nums6 as number[]; // number[]
const foo: string[] = []; // OK
const a: never[] = []; // OK
const b: never[] = [1, 2]; // Type 'number' is not assignable to type 'never'
33. Babel Coder
ENUM
enum Role {
Admin,
Moderator,
Editor,
}
const myRole: Role = Role.Admin; // 0
Role[0]; // Admin
Role.Admin // 0
enum Role {
Admin,
Moderator,
Editor,
}
enum Role {
Admin = 'Admin',
Moderator = 'Moderator',
Editor = 'Editor',
}
Role.Admin; // Admin
34. Babel Coder
INTERFACES
let person; // any
person = {
name: 'Somchai',
age: 24,
gender: 'male',
};
interface Person {
name: string;
age: number;
gender: string;
}
let person: Person;
person = {
name: 'Somchai',
age: 24,
gender: 'male',
};
// Property 'gender' is missing in type
// ‘{ name: string; age: number; }'
// but required in type 'Person'.
const person: Person = {
name: 'Somchai',
age: 24,
};
const person: Person = {
name: 'Somchai',
age: 24,
gender: 'male',
};
36. Babel Coder
READONLY AND OPTIONAL PROPERTIES
interface Person {
fi
rstName: string;
lastName: string;
middleName?: string;
readonly gender: 'Male' | 'Female';
}
let somchai: Person = {
fi
rstName: 'Somchai',
lastName: 'Haha',
gender: 'Male',
};
// Cannot assign to 'gender' because
// it is a read-only property.
somchai.gender = 'Female';
37. Babel Coder
TYPE ALIAS
interface Person {
name: string;
age: number;
gender: string;
}
type Person = {
name: string;
age: number;
gender: string;
};
interface Website {
url: string;
}
interface Article {
title: string;
content: string;
}
interface BlogPost extends Website, Article {
view: number;
}
type Website = {
url: string;
};
type Article = {
title: string;
content: string;
};
type BlogPost = Website &
Article & {
view: number;
};
38. Babel Coder
FUNCTION TYPES
function getFullName(
fi
rstName, lastName) {
return `${
fi
rstName} ${lastName}`;
}
function getFullName( fi
rstName: string, lastName: string): string {
return `${
fi
rstName} ${lastName}`;
}
const getFullName = function (
fi
rstName: string, lastName: string): string {
return `${
fi
rstName} ${lastName}`;
};
39. Babel Coder
FUNCTION TYPES
const getFullName = (
fi
rstName, lastName) => {
return `${
fi
rstName} ${lastName}`;
};
const getFullName = ( fi
rstName: string, lastName: string): string => {
return `${
fi
rstName} ${lastName}`;
};
type GetFullNameFn = (
fi
rstName: string, lastName: string) => string;
const getFullName: GetFullNameFn = (
fi
rstName, lastName) => {
return `${
fi
rstName} ${lastName}`;
};
47. Babel Coder
KEYWORD NEW
class Person {
constructor() {}
}
function get<T>(ctor: Factory<T>) {
return new ctor();
}
// const person: Person
const person = get(Person);
interface Factory<T> {
new (...args: any[]): T;
}
// OR
type Factory<T> = new (...args: any[]) => T;
51. Babel Coder
RECORD
type MyRecord<T extends string | number | symbol, U> = {
[K in T]: U;
};
type keys = 'name' | 'address';
// type MyPerson = {
// name: string;
// address: string;
// }
type MyPerson = MyRecord<keys, string>;
type Person = Record<keys, string>;
52. Babel Coder
PICK AND OMIT
type MyPick<T, K extends keyof T> = {
[P in K]: T[P];
};
type Person = {
name: string;
age: number;
address: string;
};
// type NameAndAge = {
// name: string;
// age: number;
// }
type MyNameAndAge = MyPick<Person, 'name' | 'age'>;
type NameAndAge = Pick<Person, 'name' | 'age'>;
type MyOmit<T, K extends string | number | symbol> = Pick<
T,
Exclude<keyof T, K>
>;
type Person = {
name: string;
age: number;
address: string;
};
// type MyAddress = {
// address: string;
// }
type MyAddress = MyOmit<Person, 'name' | 'age'>;
type Address = Omit<Person, 'name' | 'age'>;
53. Babel Coder
REQUIRED AND PARTIAL
type MyPartial<T> = {
[K in keyof T]?: T[K];
};
type Person = {
name: string;
age: number;
address: string;
};
// type MyPartialPerson = {
// name?: string | unde
fi
ned;
// age?: number | unde
fi
ned;
// address?: string | unde
fi
ned;
// }
type MyPartialPerson = MyPartial<Person>;
type PartialPerson = Partial<Person>;
type MyRequired<T> = {
[K in keyof T]-?: T[K];
};
type Person = {
name: string;
age: number;
address: string;
};
// type MyRequiredPerson = {
// name: string;
// age: number;
// address: string;
// }
type MyRequiredPerson = MyRequired<Person>;
type RequiredPerson = Required<Person>;
54. Babel Coder
READONLY
type MyReadonly<T> = {
readonly [K in keyof T]: T[K];
};
type Person = {
name: string;
age: number;
address: string;
};
// type MyReadOnlyPerson = {
// readonly name: string;
// readonly age: number;
// readonly address: string;
// }
type MyReadOnlyPerson = MyReadonly<Person>;
type ReadOnlyPerson = Readonly<Person>;
56. Babel Coder
DEFINITELY TYPED
// Could not
fi
nd a declaration
fi
le for module 'lodash'.
import lodash from 'lodash';
yarn add @types/lodash
yarn add @types/absinthe__socket