Professional Documents
Culture Documents
The var variables have function scope. It indicates they’re only available
within the function they were formed in, or they’re globally scoped if they
weren’t generated within a function. It won’t work if I declare var inside a
function and then try to call it from outside the function.
The number1 is a number that is globally declared. The number2 has the
scope of the function it resides in. The number3, even if it’s declared in an
if loop, it can be accessed in the function as it’s declared with the var
keyword.
Let keyword: Declaring a variable using the let keyword.
let variable : string = "geeksforgeeks";
The let variables are block-scoped. Unlike the var keyword, which declares
a variable globally to the whole function regardless of block scope, the let
keyword allows you to define variables that are confined to the scope of the
block statement or expression on which it is used.
The number1 is a number that is globally declared. The number2 has the
scope of the function it resides in. The number3 is declared in an if loop, it
can be accessed only in the if loop, it’s block-scoped as it’s declared using
the let keyword.
Const keyword: Declaring a variable using the const keyword.
const variable : number = 9;
The const variables are block scoped. Constants, like variables declared
with the let keyword, are block-scoped. A constant’s value cannot be
modified by reassigning a new value to it and the variable with the same
name cannot be redeclared either.
The number1 is a number that is globally declared. The number2 has the
scope of the function it resides in. The number3 is declared in an if loop, it
can be accessed only in the if loop, it’s block-scoped as it’s declared using
the const keyword. the const keyword is similar to let but the difference is
that const variables can’t be reassigned, variables declared using let can
be reassigned.
Advantages of AngularJS
The advantages of AngularJS are −
concerns.
Disadvantages:
Disadvantages of AngularJS
Though AngularJS comes with a lot of merits, here are some points of concern −
Javascript
let val: unknown;
console.log(val);
val = true;
console.log(val);
val = 7;
console.log(val);
console.log(val);
val = [1, 2, 3, 4];
console.log(val);
console.log(val);
val = Math.random();
console.log(val);
val = null;
console.log(val);
val = undefined;
console.log(val);
Output:
undefined
true
7
geeks for geeks
[ 1, 2, 3, 4 ]
{ name: 'rachel' }
0.776446663785197
null
undefined
Javascript
let a: unknown;
console.log(a);
let b: unknown = a;
console.log(b);
let c: any = a;
console.log(c);
Output:
undefined
undefined
undefined
Javascript
let unknown: unknown;
console.log(num);
Output:
error TS2322: Type 'unknown' is not assignable to type 'number'.
let num: number = a; // Error
Javascript
unknown_val.split("");
console.log(unknown_val);
Output:
error TS2339: Property 'split' does not exist on type 'unknown'.
Data Binding is a way to synchronize the data between the model and view
components automatically. AngularJS implements data-binding that treats
the model as the single-source-of-truth in your application & for all the
time, the view is a projection of the model. Unlike React, angular supports
two-way binding. In this way, we can make the code more loosely coupled.
Data binding can be categorized into 2 types, ie., One-way Binding &
Two-way Binding.
One-way Binding: This type of binding is unidirectional, i.e. this binds the
data flow from either component to view(DOM) or from the view(DOM) to
the component. There are various techniques through which the data flow
can be bind from component to view or vice-versa. If the data flow from
component to view(DOM), then this task can be accomplished with the help
of String Interpolation & Property Binding.
The W3C Web Ontology Language (OWL) is a Semantic Web language designed to represent
rich and complex knowledge about things, groups of things, and relations between things.
OWL is a computational logic-based language such that knowledge expressed in OWL can be
exploited by computer programs, e.g., to verify the consistency of that knowledge or to make
implicit knowledge explicit. OWL documents, known as ontologies, can be published in the
World Wide Web and may refer to or be referred from other OWL ontologies. OWL is part of
the W3C’s Semantic Web technology stack, which includes RDF, RDFS, SPARQL, etc.
The current version of OWL, also referred to as “OWL 2”, was developed by the [W3C OWL
Working Group] (now closed) and published in 2009, with a Second Edition published in
2012. OWL 2 is an extension and revision of the 2004 version of OWL developed by the [W3C
Web Ontology Working Group] (now closed) and published in 2004. The deliverables that
make up the OWL 2 specification include a Document Overview, which serves as an
introduction to OWL 2, describes the relationship between OWL 1 and OWL 2, and provides
an entry point to the remaining deliverables via a Documentation Roadmap.
Creating classes
Use the class keyword to declare a class in TypeScript. The syntax for the same is
given below −
Syntax
class class_name {
//class scope
The class keyword is followed by the class name. The rules for identifiers must be
pertaining to objects
the class
Syntax
Single Inheritance
Single inheritance can inherit properties and behavior from at most one parent class.
Multiple Inheritance
When an object or class inherits the characteristics and features form more than one
parent class, then this type of inheritance is known as multiple inheritance.
Hierarchical Inheritance
When more than one subclass is inherited from a single base class, then this type of
inheritance is known as hierarchical inheritance.
Hybrid Inheritance
When a class inherits the characteristics and features from more than one form of
inheritance, then this type of inheritance is known as Hybrid inheritance.
1. Website traffic
2. Bounce rate
The bounce rate metric tells businesses the number of visitors who leave the
website immediately after visiting. A lower bounce rate metric means more
visitors stay on the website longer and check out the content. A longer visit may
also mean visitors have found their desired service or product on the site, which
may give you a greater chance of convincing them to become digital customers
of the company's products or services.
3. Top pages
Getting data for the top-performing pages on a site can help you identify the
individual pages that generate the most traffic. Knowing the website pages that
perform the best can provide insight into what visitors like. For example, if you
get the most traffic to a particular blog, it might be worth investing more
resources to do more blog posts.
4. Conversion rate
The conversion rate measures the percentage of visitors who perform the desired
action, such as making a purchase. For example, a company with products to sell
might offer an online coupon. To track conversion rates, you divide the number of
users who have purchased a company's product with the coupon by the total
number of people who saw the advertisement.
For example, 25 people may take advantage of an offer to buy a pair of sneakers
out of 100 people who have viewed the offer. To find the conversion rate, you'd
divide the 25 people by the 100 visitors for a conversion rate of 0.25, or 25%.
Read more: What Is Google Analytics? Definition and Benefits
Customer lifetime value (CLV) is the total amount generated from a single
customer, and it can help measure the success of a particular offer over time.
This simple calculation involves adding up all the sales over a period and then
subtracting the cost of the ad.
For instance, if someone has bought $200 of takeout food from a restaurant while
using a coupon for $10 off over five years, the customer's lifetime value would be
$950. You can calculate this across all repeat customers to estimate how much
cash flow a particular online coupon might produce.
Related: How To Calculate Customer Lifetime Value and Why It's Important
Another important metric is reviewing the amount of time spent on the site or
each page. If people spend more time on the site, it can mean that you're
providing valuable content. Content creators may want to consider doing more of
the same types of content to increase the time spent on their website.
7. Returning visitors
Examining the amount of returning visitors is another way of judging the value of
a website's content. More returning visitors means more people are deciding to
come back, potentially because they like what the site offers. To calculate
returning visitors, divide the number of return visits by the website's total visits.
For instance, if you have 4,000 returning visitors and a total website visit of
10,000, you divide the returning number by the total number for a conversion rate
of 40%.
The cost per conversion (CPC) metric evaluates how much it costs in
advertisements to gain a single customer. This can help you determine how
effectively an advertising campaign produces results. To calculate your cost per
conversion, divide the cost for generating traffic by the number of conversions.
For instance, for an ad campaign that costs $100 and generates 10 conversions,
you'd divide $100 by 10 to get a CPC of $10.
Read more: 15 Digital Marketing Metrics for Businesses (And How To Use)
Exit pages tell you where a visitor decides to leave the site. Often, this can be the
same as the landing page, particularly if a site has a high bounce rate. If you
discover that most visitors leave on the same page, consider updating the page
to make it more attractive and user-friendly. For example, if a business notices
that customers tend to go halfway through placing an order, it might consider
making the ordering process easier to complete. You can also integrate links to
other content to convince people to continue to explore.
Another essential metric to track is the type of devices that visitors use to access
the site. Knowing what visitors use to get to the site is essential, as it gives you
information about how to format the content. For instance, if people are
accessing the site by mobile phone, you may consider building content formatted
for mobile devices.
AngularJS is a structural framework for dynamic web applications. It lets you use
HTML as your template language and lets you extend HTML's syntax to express
your application components clearly and succinctly.
applications. The model layer manages the application data, the view layer is
responsible for the display of this data while the controller is what connects the model
In normal MVC architectures, you have to split your app into these three components
and then write code to connect them too. However, in AngularJS, all you have to do is
split the application into MVC and it does the rest.This saves up a significant amount
of time in coding.
technique that helps user produce high quality applications. The code is divided into
the smallest testable parts i.e. units. This also helps you easily detect any flaws or
Using Angular’s module that provides mocking for tests,mock units are injected and
tested to see if the request is returned with the expected data. This helps you make
sure that each and every component of your application works exactly as required.
applications, the model and view layers are continuously updated to remain in sync
So any changes you make in your model layer will automatically be reflected in your
view layer and vice versa. This again saves a significant amount of time in coding the
As is made clear by the above characteristics, AngularJS needs a lot less coding than
others. You don’t have to write code to connect the MVC layers, you don’t have to write
separate codes for the view manually, directives are separate from the app code and
can be written parallelly etc. All of these collectively decrease the amount of coding
that is required, significantly. This also saves up your developer costs making your
5. It is developed by Google:
Google is the pioneer of the internet age and you know when there’s something that
highly skilled engineers who are readily available to solve any issues related to the
framework. Since this also provides a large community to learn from, you can also find
a number of highly skilled and expert AngularJS developers spread across the world
to assist you.
Although the list could go on, these 5 features are compelling enough to prove the
point. AngularJS has become the dominant JavaScript framework in the world of
professional web development. It helps you create a powerful and unique web
application that is yet easy to use and maintain. Given these advantages, it definitely
measureable data of your website with the aim of understanding and optimizing
time.
business prospects. There are various Web Analytics tools available in the market.
Count
It is most basic metric of measurement. It is represented as a whole number or a
Ratio
It is typically a count divided by some other count. For example, Page views per
visit.
another.
Engagement Rate
It shows how long a person stays on your web page. What all pages he surf. To
make your web pages more engaging, include informative content, visuals, fonts
and bullets.
Bounce Rate
If a person leaves your website within a span of 30 sec, it is considered as a bounce.
The rate at which users spin back is called the bounce rate.
To minimize bounce rate include related posts, clear call-to-action and backlinks in
your webpages.
Dashboards
Dashboard is single page view of information important to user. You can create your
own dashboards keeping in mind your requirements. You may keep only frequently
Event Tracking
Event tracking allows you to track other activities on your website. For example,
The typeof operator can be used as a Type guard in TypeScript and returns a string
that indicates the type of a value.
The typeof type guards can be acknowledged in two different forms: typeof t ===
"typename" and typeof t !== "typename" where typename is one of the return values of
typeof. The return values can be undefined, number, string, boolean, object or
function.
Syntax
The syntax for defining the TypeScript typeof keyword is as follows:
We can directly make use of typeof with the variable name that we want to define.
After this declaration, we can write our logic as per the code's requirements.
It is used to create new basic types. If we define our custom types, then we can use
typeof to copy the type of an existing item. It is majorly used with identifiers (i.e
variable names) or their properties.
Directives are special attributes starting with ng- prefix. Following are the most
common directives:
○ ng-repeat: This directive repeats html elements for each item in a collection.
ng-app directive
ng-app directive defines the root element. It starts an AngularJS Application and
automatically initializes or bootstraps the application when web page containing
AngularJS Application is loaded. It is also used to load various AngularJS modules in
AngularJS Application.
Play Video
ng-init directive
ng-init directive initializes an AngularJS Application data. It defines the initial values
for an AngularJS application.
In following example, we'll initialize an array of countries. We're using JSON syntax to
define array of countries.
ng-model directive:
ng-model directive defines the model/variable to be used in AngularJS Application.
ng-repeat directive
ng-repeat directive repeats html elements for each item in a collection. In following
example, we've iterated over array of countries.
Anonymous functions are used as inline functions. These are used when
the function is used only once and does not require a name. The best
example is a callback function.
during runtime
anonymous function
2. Caching capabilities
SPAs request data from the server just one time, upon
initial download, so caching works better; if a user
has a poor internet connection, site data can be
accessed with the server when the connection
improves.