w3resource

JavaScript - Exercises, Practice, Solution

What is JavaScript?

JavaScript is a cross-platform, object-oriented scripting language. It is a small and lightweight language. Inside a host environment ( a web browser), JavaScript can be connected to the objects of its environment to provide programmatic control over them.

JavaScript contains a standard library of objects, such as Array, Date, and Math, and a core set of language elements such as operators, control structures, and statements. Core JavaScript can be extended for a variety of purposes by supplementing it with additional objects.

The best way we learn anything is by practice and exercise questions. We have started this section for those (beginner to intermediate) who are familiar with JavaScript. Hope, these exercises help you to improve your JavaScript coding skills. Currently following sections are available, we are working hard to add more exercises. Happy Coding!

List of JavaScript Exercises :

More to Come !

Popularity of Programming Language
Worldwide, Aug 2022 compared to a year ago:

`
Rank Change Language Share Trend
1 Python 28.11 % -2.6 %
2 Java 17.35 % -0.9 %
3 Javascript 9.48 % +0.2 %
4 C# 7.08 % +0.1%
5 C/C++ 6.19 % -0.3 %
6 PHP 5.47 % -0.8 %
7 R 4.35 % +0.6 %
8 up arrow TypeScript 2.79 % +1.1 %
9 up arrow Swift 2.09 % +0.5 %
10 down arrow Objective-C 2.03 % +0.2 %
11 up arrow Go2.03% +0.5 %
12 down arrow Kotlin 1.78 % -0.0 %
13 up arrow Rust 1.58 % +0.8 %
14 down arrow Matlab 1.52 % +0.1 %
15 Ruby 1.15 % +0.1%
16 down arrow VBA 1.02 % -0.2 %
17 up arrow Dart 0.83 % +0.2 %
18 up arrow Ada 0.78 % +0.2 %
19 Scala 0.73 % +0.2 %
20 up arrow Lua 0.64 % +0.1 %
21 down arrow Visual Basic 0.6 % -0.2 %
22 Abap 0.48 % -0.0 %
23 up arrow Julia 0.43 % +0.1 %
24 down arrow Groovy 0.41 % -0.1 %
25 down arrow Perl 0.32 % -0.1 %
26 Cobol 0.32 % +0.0 %
27 Haskell 0.26 % +0.1 %
28 Delphi/Pascal 0.18 % +0.2 %

Source : https://pypl.github.io/PYPL.html

TIOBE Index for August 2022

Aug 2022 Aug 2021 Change Programming Language Ratings Change
1 2 up arrow Python 15.42% +3.56%
2 1 down arrow C 14.59% 2.03%
3 3 Java 12.40% +1.96%
4 4 C++ 10.17% +2.81%
5 5 C# 5.59% +0.45%
6 6 Visual Basic 4.99% +0.33%
7 7 JavaScript 2.33% -0.61%
8 9 up arrow Assembly language 2.17% +0.14%
9 10 up arrow SQL 1.70% +0.23%
10 8 down arrow PHP 1.39% -0.80%
11 16 up arrow Swift 1.27% +0.30%
12 12 up arrow Classic Visual Basic 1.27% +0.04%
13 22 up arrow Delphi/Object Pascal 1.22% +0.60%
14 23 up arrow Objective-C 1.22% +0.61%
15 18 up arrow Go 0.98% +0.08%
16 14 down arrow R 0.92% -0.13%
17 17 MATLAB 0.90% -0.08%
18 15 down arrow Ruby 0.82% -0.18%
19 13 down arrow Fortan 0.81% -0.32%
20 20 up arrow Perl 0.72% -0.06%

Source : https://www.tiobe.com/tiobe-index/

Do not submit any solution of the above exercises at here, if you want to contribute go to the appropriate exercise page.

Note : Since JavaScript is a loosely-typed, dynamic and expressive language, you may accomplish the same task in various ways. Therefore the ways (solution of the exercises) described here are not the only ways to do stuff. Rather, it would be great, if this helps you anyway to choose your own methods.

[ Want to contribute to JavaScript exercises? Send your code (attached with a .zip file) to us at w3resource[at]yahoo[dot]com. Please avoid copyrighted materials.]



Share this Tutorial / Exercise on : Facebook and Twitter

JavaScript: Tips of the Day

Tagged template literals

function getPersonInfo(one, two, three) {
  console.log(one);
  console.log(two);
  console.log(three);
}

const person = 'Lydia';
const age = 21;

getPersonInfo`${person} is ${age} years old`;

If you use tagged template literals, the value of the first argument is always an array of the string values. The remaining arguments get the values of the passed expressions!

Ref: https://bit.ly/323Y0P6