JavaScript is one of the most popular skills in today’s job market. It allows you to create both client- and server-side applications quickly and easily. Having a solid understanding of this powerful and versatile language is essential to anyone who uses it.
“Practical JavaScript Programming” does not only focus on best practices, but also introduces the fundamental concepts. This course will take you from JavaScript basics to advanced. You’ll learn about topics like Data Types, Functions, Events, AJAX and more.
This document discusses ECMAScript 2015 (ES2015), also known as ES6. It provides examples of new ES2015 features like arrow functions, template literals, classes, and modules. It also discusses how to set up a development environment to use ES2015, including transpiling code to ES5 using Babel, linting with Eslint, testing with Mocha, and generating coverage reports with Istanbul. The document emphasizes that while ES2015 is fun to explore, proper tooling like linting and testing is needed for serious development. It concludes by noting ES2015 marks a transition and thanks the audience.
- Ruby is an interactive, object-oriented programming language created by Yukihiro Matsumoto in 1995.
- Ruby on Rails is a web application framework built on Ruby that emphasizes convention over configuration and is optimized for programmer happiness.
- The document discusses Ruby and Ruby on Rails, providing an overview of their history, key principles like MVC, REST, and conventions used in Rails. It also provides examples of modeling data with classes and ActiveRecord in Rails.
The document appears to be notes on Backbone.js. It includes summaries of Backbone models, events, views and how to bind events. It demonstrates creating a model with defaults, getting/setting attributes, and binding event handlers. It also shows creating a view with tagName, className and attributes, and logging the generated HTML element.
The document discusses Ruby and Ruby on Rails. It notes that Ruby is an object-oriented programming language created by Yukihiro Matsumoto in 1995. Ruby on Rails is a web application framework built on Ruby that was created by David Heinemeier Hansson in 2004. It follows the model-view-controller architectural pattern, separating applications into models, views, and controllers.
This document discusses quality assurance (QA) for PHP projects. It introduces various QA tools and techniques including syntax checking, documentation, testing, version control and code coverage. Screenshots are provided to illustrate concepts like detecting bugs early, observing behavior and preventing mistakes. The document also includes exercises for attendees to practice setting up version control with Git, running syntax checks with PHP Lint, generating documentation with phpDocumentor, and testing models with PHPUnit.
Elixir and Dialyzer, Types and Typespecs, using and understanding themDan Janowski
A Talk given at NYCElixir Feb 21, 2017 by Dan Janowski. An introduction to types in Elixir, success typing, and examples of how to write typespecs as well as including dialyzer in your app and some details on how to interpret the output.
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects. Come make your code look and function better.
Love it or hate it, JavaScript is playing an increasingly important role in the next generation of web and mobile apps. As code continues to move from the server to the client, JavaScript is being used to do more than simple HTML manipulation. Be prepared for this transition and make sure the JavaScript you write is optimized and ready to perform on desktops and devices! In this session, you will learn ten practical tips that you can use today to write faster, more maintainable, memory friendly JavaScript.
Rails-like JavaScript Using CoffeeScript, Backbone.js and JasmineRaimonds Simanovskis
The document discusses using CoffeeScript to write JavaScript code in a more Ruby-like style. It provides examples of CoffeeScript code for functions, objects, classes, and other concepts. CoffeeScript allows JavaScript code to be written in a cleaner syntax that resembles Ruby. This helps address problems with JavaScript code appearing "ugly" and unfamiliar to developers experienced in Ruby. CoffeeScript transpires to regular JavaScript, enabling the Ruby-like code to run in browsers.
The document discusses generating headless JavaScript tests for validations. It describes problems with testing JavaScript across many views, models, and validations. It proposes using server-side and client-side validations, widgets, localization, and regular expressions to solve these problems. Tests are generated and executed using RSpec and a standalone JavaScript interpreter to test validations without a browser.
This document discusses advanced JavaScript techniques. It covers object-oriented JavaScript concepts like references, function overloading, type checking, scopes, closures, object creation, and inheritance. It also discusses performance improvements like scope management, object caching, and optimizing DOM selection. Finally, it discusses debugging and testing JavaScript code as well as distributing JavaScript applications.
“Writing code that lasts” … or writing code you won’t hate tomorrow. - PHPKonfRafael Dohms
As developers we write code everyday, only to frown at it a week after that. Why do we have such a hard time with code written by others and ourselves, this raging desire to rewrite everything we see? Writing code that survives the test of time and self judgment is a matter of clarity and simplicity. Let's talk about growing, learning and improving our code with calisthenics, readability and good design.
The document discusses different approaches for handling asynchronous code in JavaScript, including callbacks, promises, and async/await. It provides examples of each approach, such as using callbacks for sequential asynchronous functions, chaining promises together, and using async/await to write asynchronous code that looks synchronous. It also addresses error handling with each approach, noting that while async/await code looks cleaner, error handling can be more complex so different options like try/catch blocks are demonstrated.
The document discusses the history and evolution of jQuery, including major releases and changes over time. It describes how jQuery moved from a concatenated file structure to using RequireJS and module dependencies. It also covers changes in licensing between versions. Finally, it provides examples of how jQuery handles different selector types and error checks selector input.
The document provides an overview of learning bottom up JavaScript, including the key things it will cover: the JavaScript language, Document Object Model (DOM), how JS and DOM cooperate, libraries, development tools, and resources. It describes the main aspects of JavaScript like being dynamic, weakly typed, prototype-based, and using first-class functions. It also explains the three main things done with JS: attaching event listeners, getting/modifying data, and updating the page.
This document summarizes Rails on Oracle and the Oracle enhanced ActiveRecord adapter. It discusses the main components, how the adapter maps data types between Ruby/Rails and Oracle, and how it handles legacy schemas, PL/SQL CRUD procedures, and full-text indexes. It also provides information on testing, contributing, reporting issues and related libraries.
This document provides an overview and examples of several design patterns in object-oriented programming with PHP, including Strategy, Factory, Abstract Factory, Adapter, Singleton, Iterator, and Observer patterns. The Strategy pattern allows making decisions on different cases more easily by encapsulating varying implementations of an algorithm. The Factory pattern hides object creation logic and allows for polymorphic object instantiation. The Abstract Factory pattern ensures all created objects conform to a common interface. The Adapter pattern allows incompatible interfaces to work together by wrapping an object to fit expected interfaces. The Singleton pattern ensures only one instance of a class is created. The Iterator pattern provides a way to access elements of an object sequentially without exposing its underlying representation. The Observer pattern allows objects to publish
This document discusses class-based views in Django. It covers Django's emphasis on reusability through generic views and a thriving ecosystem of third-party applications. Generic views encapsulate common patterns like listing and editing objects. While powerful, generic views have some limitations like an inability to swap the ORM. The document also discusses making the admin interface more customizable and decoupled from Django through subclassing, as well as implementing fine-grained permissions by overriding methods in ModelAdmin subclasses. Finally, it suggests that any component that follows the request-response pattern could be implemented as a class, including decorators.
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 discusses proven JavaScript best practices for writing better code. It covers topics like always using var to declare variables, avoiding eval(), using object literals instead of the Object constructor, preferring === over ==, ending statements with semicolons, and turning on strict mode. Each topic is demonstrated with examples of bad code and how to fix it. The document aims to help programmers structure their code properly and avoid common pitfalls in JavaScript.
eact is a library for building HTML user interfaces. It is the "view" in a Model-View-Controller application. Created by the UI wizards at Facebook, top websites like Instagram, Netflix, Airbnb, Bleacher Report and Feedly use it. React is the 6th most starred project on GitHub and grows more popular every day.
In this two-day workshop, we will introduce you to React. On the first day, we will work through a series of increasingly more complicated tutorial exercises. Along the way, we will explain concepts like JSX, immutability, statefulness, one-way data flow, components, and virtual DOM.
With the basics out of the way, we will spend the second-day building a complex application which will put React through its paces and give us a chance to explore most of its features. Then we will learn how to think in React. We will show you how to go from design to components to working application. We will wrap the weekend with a quick preview of React Native, which allows you to use your React skills to create cross-platform mobile apps.
ASTs are an incredibly powerful tool for understanding and manipulating JavaScript. We'll explore this topic by looking at examples from ESLint, a pluggable static analysis tool, and Browserify, a client-side module bundler. Through these examples we'll see how ASTs can be great for analyzing and even for modifying your JavaScript. This talk should be interesting to anyone that regularly builds apps in JavaScript either on the client-side or on the server-side.
Beginning Scala with Skinny Framework #jjug_cccKazuhiro Sera
This document provides an overview of the Skinny Framework for building Scala web applications. It discusses how to get started with a basic Skinny application, the MVC structure used in Skinny, database modeling and access using Skinny ORM, and other features like validation, routing and scaffolding. Key points covered include bootstrapping a Skinny app, writing basic controllers and views, defining models and relationships, and generating CRUD pages automatically with scaffolding.
The document discusses JavaScript, describing it as:
- Created in 1995 by Netscape and based on the ECMAScript standard.
- A dynamic, weakly typed, object-oriented programming language that is often misunderstood.
- Used for client-side scripting of webpages as well as server-side and application scripting.
- Commonly disliked due to past bad practices, implementations, and browser differences, but these issues are improving over time.
This document provides an outline and overview of client-side technologies including JavaScript, DOM, and jQuery. The outline covers JavaScript concepts like data types, control structures, arrays, functions, and objects. It also covers DOM levels and manipulating the DOM. Finally, it discusses jQuery and how to load, select elements, handle events, and more. The presentation aims to familiarize students with these important front-end technologies.
This document provides an outline and overview of client-side technologies including JavaScript, DOM, and jQuery. The outline includes sections on JavaScript concepts like data types, control structures, arrays, functions, and objects. It also covers DOM levels and manipulating the DOM, as well as introductions to jQuery for selecting elements, changing styles, and handling events. The presentation provides an overview of these key client-side technologies for students.
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
- JavaScript is a client-side scripting language used to make web pages dynamic. It is embedded in HTML and runs in web browsers.
- JavaScript code can be placed inline in HTML, in <script> tags in the <head> or <body>, or linked via external .js files.
- The document covers JavaScript syntax, data types, string operations, functions, form validation, and examples of alerts, prompts, and calculating sums.
TYPO3 Extension development using new Extbase frameworkChristian Trabold
My presentation for the TYPO3 community day in Tokyo, Japan.
The code is available at https://github.com/ctrabold/t3ski-workshop.
Due to copyright issues I had to remove all pictures of Miffy.
A talk about how Javascript developers can make better and less error prone code by adopting two practices: using type-checkers to validate types during the development process, using Flowtype as an example; and by applying some common clean code practices to make their code more readable.
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.
This document discusses Java bytecode fundamentals including:
- Bytecode is composed of one-byte instructions with ~200 opcodes in use
- The javap tool can be used to disassemble classes and view bytecode
- The Java Virtual Machine is stack-based and each thread has a stack frame containing an operand stack and local variables
- Bytecode instructions manipulate the stack and local variables to implement method calls and object initialization
1) Qooxdoo is a JavaScript framework that provides object-oriented programming features to JavaScript. It turns JavaScript into a "grown up OO language" and allows developers to write browser-based applications without needing HTML or CSS knowledge.
2) The document discusses how to get started with a basic "Hello World" Qooxdoo application by installing Python, unpacking Qooxdoo, and generating and running the application files.
3) Key aspects of programming with Qooxdoo include leveraging JavaScript features like anonymous functions, closures, and proper understanding of scoping, as the framework relies heavily on these elements.
The document discusses Symfony2 and how it can be used to build PHP applications. It covers Symfony concepts like the MVC pattern, routing, bundles, environments, and caching. Code examples are provided for controllers, templates, routing configuration, and more to illustrate how Symfony applications work.
The document summarizes the OWASP Top 10 security risks and provides prevention techniques. It discusses injection, cross-site scripting (XSS), insecure deserialization, XML external entities (XXE), and other risks. For each risk, it recommends validating, sanitizing, and escaping user input, using prepared statements, and other best practices to prevent security vulnerabilities.
JavaScript, like it or not, has become the most important language on the web. Nearly every developer who builds Internet apps has to use it. But JavaScript can be tough to write and even tougher to read. So here are ten tips to help you get groovy with JavaScript.
This afternoon I gave a very short introduction to computer programming at Trade School (tradeschool.ourgoods.org). I used JavaScript to illustrate the process of learning how to program, mainly because there's nothing to install and it has many practical uses.
Similar to Practical JavaScript Programming - Session 1/8 (20)
Using API mocking tools in the browser helps front-end developers to build web application without having to rely on any backend services.
Mirage runs a mock server alongside the rest of your frontend JavaScript code and existing code dose not need to be changed. It also provides many rich tools for data modelling.
NestJS (https://nestjs.com/) is a Node.js framework for building server-side applications. This slide give you a brief introduction of Nest, and shows the examples like Service, Middleware, and Pipe, etc.
This is a guide for product issues management and development process using Jira. The Issue Types and Workflows can be customized by Jira system administrators. Every development team should always discuss and define its own standards to follow. This slide shows the common Issue Types and Workflows for your reference, and some brief views of the Scrum Board and Reports.
This slide contains two parts of content. First, CSS Grid Layout, offering a grid-based layout system, with rows and columns, making it easier to design web pages without having to use floats and positioning. Second, Progressive Web App, using modern web capabilities to deliver an app-like experience to users on desktop and mobile.
Responsive web design allows a single template to be delivered across all devices by using media queries to detect the device. It allows for longer page loads but existing websites do not need rebuilding. Adaptive web design delivers separate templates for each device through server-side detection, allowing for faster page loads but requiring alterations to existing websites. CSS media queries and breakpoints are important techniques for responsive design, along with fluid grids, modifying box size, spacing, fonts and images based on screen width. Common patterns include revealing, transforming, dividing, reflowing, expanding and positioning content. Single page applications load all necessary code at once allowing speedy secondary page loads but can increase initial load time and complexity.
Practical JavaScript Programming - Session 3/8Wilson Su
JavaScript is one of the most popular skills in today’s job market. It allows you to create both client- and server-side applications quickly and easily. Having a solid understanding of this powerful and versatile language is essential to anyone who uses it.
“Practical JavaScript Programming” does not only focus on best practices, but also introduces the fundamental concepts. This course will take you from JavaScript basics to advanced. You’ll learn about topics like Data Types, Functions, Events, AJAX and more.
Practical JavaScript Programming - Session 2/8Wilson Su
JavaScript is one of the most popular skills in today’s job market. It allows you to create both client- and server-side applications quickly and easily. Having a solid understanding of this powerful and versatile language is essential to anyone who uses it.
“Practical JavaScript Programming” does not only focus on best practices, but also introduces the fundamental concepts. This course will take you from JavaScript basics to advanced. You’ll learn about topics like Data Types, Functions, Events, AJAX and more.
An Internet Protocol address (IP address) is a logical numeric address that is assigned to every single computer, printer, switch, router, tablets, smartphones or any other device that is part of a TCP/IP-based network.
Types of IP address-
Dynamic means "constantly changing “ .dynamic IP addresses aren't more powerful, but they can change.
Static means staying the same. Static. Stand. Stable. Yes, static IP addresses don't change.
Most IP addresses assigned today by Internet Service Providers are dynamic IP addresses. It's more cost effective for the ISP and you.
Conservation of Taksar through Economic RegenerationPriyankaKarn3
This was our 9th Sem Design Studio Project, introduced as Conservation of Taksar Bazar, Bhojpur, an ancient city famous for Taksar- Making Coins. Taksar Bazaar has a civilization of Newars shifted from Patan, with huge socio-economic and cultural significance having a settlement of about 300 years. But in the present scenario, Taksar Bazar has lost its charm and importance, due to various reasons like, migration, unemployment, shift of economic activities to Bhojpur and many more. The scenario was so pityful that when we went to make inventories, take survey and study the site, the people and the context, we barely found any youth of our age! Many houses were vacant, the earthquake devasted and ruined heritages.
Conservation of those heritages, ancient marvels,a nd history was in dire need, so we proposed the Conservation of Taksar through economic regeneration because the lack of economy was the main reason for the people to leave the settlement and the reason for the overall declination.
Exploring Deep Learning Models for Image Recognition: A Comparative Reviewsipij
Image recognition, which comes under Artificial Intelligence (AI) is a critical aspect of computer vision,
enabling computers or other computing devices to identify and categorize objects within images. Among
numerous fields of life, food processing is an important area, in which image processing plays a vital role,
both for producers and consumers. This study focuses on the binary classification of strawberries, where
images are sorted into one of two categories. We Utilized a dataset of strawberry images for this study; we
aim to determine the effectiveness of different models in identifying whether an image contains
strawberries. This research has practical applications in fields such as agriculture and quality control. We
compared various popular deep learning models, including MobileNetV2, Convolutional Neural Networks
(CNN), and DenseNet121, for binary classification of strawberry images. The accuracy achieved by
MobileNetV2 is 96.7%, CNN is 99.8%, and DenseNet121 is 93.6%. Through rigorous testing and analysis,
our results demonstrate that CNN outperforms the other models in this task. In the future, the deep
learning models can be evaluated on a richer and larger number of images (datasets) for better/improved
results.
A vernier caliper is a precision instrument used to measure dimensions with high accuracy. It can measure internal and external dimensions, as well as depths.
Here is a detailed description of its parts and how to use it.
Social media management system project report.pdfKamal Acharya
The project "Social Media Platform in Object-Oriented Modeling" aims to design
and model a robust and scalable social media platform using object-oriented
modeling principles. In the age of digital communication, social media platforms
have become indispensable for connecting people, sharing content, and fostering
online communities. However, their complex nature requires meticulous planning
and organization.This project addresses the challenge of creating a feature-rich and
user-friendly social media platform by applying key object-oriented modeling
concepts. It entails the identification and definition of essential objects such as
"User," "Post," "Comment," and "Notification," each encapsulating specific
attributes and behaviors. Relationships between these objects, such as friendships,
content interactions, and notifications, are meticulously established.The project
emphasizes encapsulation to maintain data integrity, inheritance for shared behaviors
among objects, and polymorphism for flexible content handling. Use case diagrams
depict user interactions, while sequence diagrams showcase the flow of interactions
during critical scenarios. Class diagrams provide an overarching view of the system's
architecture, including classes, attributes, and methods .By undertaking this project,
we aim to create a modular, maintainable, and user-centric social media platform that
adheres to best practices in object-oriented modeling. Such a platform will offer users
a seamless and secure online social experience while facilitating future enhancements
and adaptability to changing user needs.
Encontro anual da comunidade Splunk, onde discutimos todas as novidades apresentadas na conferência anual da Spunk, a .conf24 realizada em junho deste ano em Las Vegas.
Neste vídeo, trago os pontos chave do encontro, como:
- AI Assistant para uso junto com a SPL
- SPL2 para uso em Data Pipelines
- Ingest Processor
- Enterprise Security 8.0 (Maior atualização deste seu release)
- Federated Analytics
- Integração com Cisco XDR e Cisto Talos
- E muito mais.
Deixo ainda, alguns links com relatórios e conteúdo interessantes que podem ajudar no esclarecimento dos produtos e funções.
https://www.splunk.com/en_us/campaigns/the-hidden-costs-of-downtime.html
https://www.splunk.com/en_us/pdfs/gated/ebooks/building-a-leading-observability-practice.pdf
https://www.splunk.com/en_us/pdfs/gated/ebooks/building-a-modern-security-program.pdf
Nosso grupo oficial da Splunk:
https://usergroups.splunk.com/sao-paulo-splunk-user-group/
Online music portal management system project report.pdfKamal Acharya
The iMMS is a unique application that is synchronizing both user
experience and copyrights while providing services like online music
management, legal downloads, artists’ management. There are several
other applications available in the market that either provides some
specific services or large scale integrated solutions. Our product differs
from the rest in a way that we give more power to the users remaining
within the copyrights circle.
2. Outline
2
Practical JavaScript Programming
Chapter 1.
● Introductions
● Placing JavaScripts
● JavaScript Output
● Browser Compatibility
● Development Tools
Getting Started
Chapter 2.
Variables
● Variable Declarations
● Data Types
● Literals
● Data Type Conversion
● Scoping
● Variable Hoisting
3. 3
Wilson Su
Front-end Developer, HIE
● 6 years in web design
● Specialize in JavaScript /
CSS / HTML / OOP / Git
● Familiar with PHP / Design
Pattern
● Interested in UI & Ix Design
wilson_su@trend.com.tw
4. 4
Q1. Is there anyone who does not have any
programming experience?
Q2. Is there anyone who has experience with
programming in JavaScript?
Q3. Is there anyone who has experience with
programming in JavaScript for more than 3 years?
Quick Survey
Practical JavaScript Programming
9. What Is JavaScript?
● JavaScript is abbreviated as "JS".
● It is a dynamic, untyped, interpreted, cross-platform, object-oriented
language.
● It is standardized in the ECMAScript language specification.
● It is most commonly used as part of web browsers.
● It also being used in server-side programming.
● JavaScript (Client) = ECMAscript + DOM + BOM
Introductions
9
10. What Can JavaScript Do?
✓ Visual effects
✓ Simple calculations
✓ User data manipulation
✓ Data validation
✓ Data storage
✓ Dynamicaly change page structure
✓ Get data from server
Introductions
10
12. Keywords And Reserved Words
Introductions
arguments await break case catch class const continue
debugger default delete do else enum eval export extends
false finally for function let if implements import in
Infinity instanceof interface NaN new null package private
protected public return static super switch this throw true
try typeof undefined var void while with yield
12
39. Declarations
39
Variable Declarations
var Declares a variable, optionally initializing
it to a value.
let Declares a block-scoped, local variable,
optionally initializing it to a value.
const Declares a block-scoped, read-only named
constant.
40. JavaScript Identifiers
40
– can contain letters, digits, underscores, and dollar signs
– must begin with a letter
– can also begin with $ and _
– are case sensitive
– cannot use reserved words
Variable Declarations
41. Variable Declarations
1. var color = 'red';
2. var cat, dog, sheep;
3. var _id = 100, $last = true, lastName = 'Wang';
4. var fruit = 80,
5. vegetable = 40,
6. bread = 50;
7.
8. let bag = 'plastic';
9.
10. const TYPE_CARD = 'CARD';
41
43. Primitive Data Types
1. var title = 'FED'; // string
2. var salary = 22000; // number
3. var children = false; // boolean
4. var car = undefined; // undefined
5. var house = null; // null
43
/* THE ABOVE CONTENT IS PURELY FICTIONAL */
44. Built-in Objects
Data Types
Object Function
Boolean Number String
Date Math RegExp
Array Map Set
Promise JSON
Error SyntaxError ReferenceError
...
44
52. Multiline Strings
52
1. console.log('Hello
2. World!'); // 'Hello World!'
3.
4. console.log('line one n another line');
5. // line one
6. another line
7.
8. console.log('line one
9. another line'); // ?
1. console.log('Hello
2. World!'); // 'Hello World!'
3.
4. console.log('line one n another line');
5. // 'line one
6. another line'
7.
8. console.log('line one
9. another line'); // SyntaxError
53. String Interpolation
53
1. var price = 999;
2. var book = `The book costs ${price} dollars.`;
3. console.log(book); // 'The book costs 999 dollars.'
4.
5. var cat = 'Apple';
6. var dog = 'Pen';
7. var pets = `I have a cat, ${cat}.
8. I have a dog, ${dog}.
9. Ummm, ${cat}-${dog}`;
10. console.log(pets); // 'I have a cat, Apple.
11. I have a dog, Pen.
12. Ummm, Apple-Pen'
57. You don't have to specify the
datatype of a variable when you
declare it, and data types are
converted automatically as
needed during script execution.
57
75. Setting and Getting Global Variables
75
1. window.title = 'JavaScript';
2. console.log(window.title); // 'JavaScript'
3. console.log(title); // 'JavaScript'
76. Local Variables
76
1. let title = 'JavaScript';
2. console.log(title); // 'JavaScript'
3. console.log(window.title); // ?
1. let title = 'JavaScript';
2. console.log(title); // 'JavaScript'
3. console.log(window.title); // undefined
77. Lifetime of Variables
Scoping
77
● The lifetime of a variable starts when it is declared.
● Local variables are deleted when the function is completed.
● Global variables are deleted when you close the browser window.