Language Selection

English French German Italian Portuguese Spanish

JavaScript (JS) Programming

Filed under
Development
  • What are Callback Functions in JavaScript?

    If you’re a programmer, you’ve probably heard of functions, which are a set of statements that perform an action and return an output but what are callback functions?

    The callback function is an extremely important concept of javascript and is widely used in promises, event listeners, arrays, and much more.

    We’ll go over what callback functions are and how to use them in JavaScript in this tutorial as well as We will also talk about the synchronous and asynchronous callback functions. To have clear and profound concepts of Callback functions we will implement some examples as well.

  • What Does the “use strict” Directive Do in JavaScript

    JavaScript evolved for a long time having no compatibility issues and modified by adding new features but not changing the old features. It had its advantages and disadvantages and the advantage was that it didn’t allow the breaking of the existing code, however, the disadvantage was that any error made by the developers or creators was stuck within JavaScript forever.

    It carried on until ECMAScript 5 (also referred to as ES5) was introduced in 2009 whose perk was that it added new features while modifying current ones. However, by default in JavaScript, these modifications are off. One needs to enable it with a special message or command which is the “use strict”.

  • Top 10 Popular Websites Built using JavaScript – Examples

    Popularity of JavaScript is increasing day by day with it’s usage for building websites, mobile applications, web based games and server side applications. It’s a client side scripting language but with the introduction of NodeJs, it’s now possible to handle server side as well.

    JavaScript is evolving everyday, making it’s way more into the tech world by introducing various frameworks, which makes the life of developers easy. Many websites which are popularly known are built around JavaScript which shows how important and useful the language is. In this write-up, you will have the top 10 popular websites built using JavaScript.

  • What are JavaScript Object Accessors

    JavaScript object accessors are used to access and update the objects and two keywords used for this function are getter and the other is the setter. JavaScript introduced getters and setters in ES5 in 2009.

    We’ll look at what getters and setters are and how to utilize them in JavaScript in this tutorial as well as go over why you should use get or set methods of JavaScript. Apart from this, we will discuss the object.defineProperty() as well. In the end, we will shine some light on which browser supports the set and get methods. So let’s get started.

  • How to Reverse an Array in JavaScript

    Reversing an array is a very popular coding problem which is often asked as an interview question when applying for an entry level JavaScript Developer position. Sometimes you will be asked to modify the original array so that the first element becomes the last and the second element becomes the second last element of the array and so on. Sometimes you might be asked to reverse an array without changing the original array.

    In this post we will look at different methods which are used to reverse an array in JavaScript; these methods will include the methods which reverse the original array as well as methods which can be used to make a new reversed array.

  • How to Speed up the Execution of JavaScript Code

    When developing an app or a website, one of the most crucial elements to consider is the app’s or website’s performance. As a user, I wouldn’t want any app to take a long time to load or whenever I click something and I have to wait for some action. Often if the webpage takes 5-6 seconds to load most users including me would leave the webpage.

    For web developers, JavaScript is a fantastic tool. Every web developer learned JavaScript at some point in their life. However, poor JavaScript code results in slower websites.

    With this in mind, a developer always looks at ways of improving his webpage. You are in luck because today we are going to talk about how to speed up the execution of JavaScript code.

  • How to Write a JavaScript Program to Get File Extension from File Name?

    The file extension is a three or four-letter abbreviation or an acronym at the end of a file that tells you what kind of file it is under different operating systems. For example, the file name is code.js hence the extension here is js. The goal of this article is to show you how to write a JavaScript program to get file extensions from a file name. We will discuss two of the easiest and most used methods to find the file extension.

  • How to Reverse a String in JavaScript

    Reversing an array is a very popular coding problem that is often asked as an interview question to beginner JavaScript devs. Sometimes the interviewers add certain restrictions, forcing you to come up with ingenious solutions.

    In JavaScript, a string can be reversed by many different methods. In this post we will discuss the most creative and interesting methods for reversing a string.

  • How to Link JavaScript to HTML

    JavaScript is a very popular scripting language which is used both on the client-side as well as on the server-side. JavaScript is necessary for our web pages as it makes our web page interactive.

More in Tux Machines

Security Leftovers

  • Linux Fixes Spectre V1 SWAPGS Mitigation After Being Partially Borked Since Last Year - Phoronix

    This week's set of "x86/urgent" changes for the Linux 5.16-rc4 kernel due out later today has some Spectre V1 fixes after kernel commits last year ended up partially messing things up around its SWAPGS handling. These fixes in turn will also likely be back-ported to relevant stable kernel series. Thanks to an Alibaba engineer, Lai Jiangshan, are some important fixes around the Spectre V1 SWAPGS mitigation that are landing today in the mainline kernel.

  • Reproducible Builds: Reproducible Builds in November 2021

    As a quick recap, whilst anyone may inspect the source code of free software for malicious flaws, almost all software is distributed to end users as pre-compiled binaries. The motivation behind the reproducible builds effort is therefore to ensure no flaws have been introduced during this compilation process by promising identical results are always generated from a given source, thus allowing multiple third-parties to come to a consensus on whether a build was compromised. If you are interested in contributing to our project, please visit our Contribute page on our website.

  • Reproducible Builds (diffoscope): diffoscope 195 released

    The diffoscope maintainers are pleased to announce the release of diffoscope version 195. This version includes the following changes:

    [ Chris Lamb ]
    * Don't use the runtime platform's native endianness when unpacking .pyc
      files to fix test failures on big-endian machines.
    

Linux 5.16-rc4

Fairly small rc4 this week. Three areas stand out in the diff: some
kvm fixes (and tests), network driver fixes, and the tegra SoC sound
fixes.

The rest is fairly spread out: drm fixes, some filesystem stuff,
various arch updates, and some smattering of random driver fixes.

Nothing looks all that scary, although I certainly hope the kvm side
will calm down.

                  Linus
Read more Also: Linux 5.16-rc4 Released - "Nothing Looks All That Scary"

EFF Argument in Patent Troll Case to Be Livestreamed on Monday

At 10 am Monday, FOSS folks and others interested in software patent litigation will have a chance to have a firsthand look at how our courts address patent cases. The case involves a “notorious patent troll,” according to Electronic Frontiers Foundation, that is trying to hide information from Apple, which it’s suing. “At a federal appeals court hearing that will be livestreamed, attorney Alexandra H. Moss, Executive Director at Public Interest Patent Law Institute, who is assisting EFF in the case, will argue that a judge’s order to unseal all documents and preserve public access in the case of Uniloc USA, Inc. v. Apple Inc. should be upheld,” EFF said in a statement on Thursday. “Uniloc is entitled to resolve its patent dispute in publicly-funded courts, Moss will argue, but it’s not entitled to do so secretly.” EFF said that this is the second time the plaintiff, Uniloc, has appealed an order to be more transparent in this case. Read more

Gnuastro 0.16 released

Dear all,

I am happy to announce the 16th official release of GNU Astronomy
Utilities (Gnuastro version 0.16).

Gnuastro is an official GNU package, consisting of various
command-line programs and library functions for the manipulation and
analysis of (astronomical) data. All the programs share the same basic
command-line user interface (modeled on GNU Coreutils). For the full
list of Gnuastro's library, programs, and a comprehensive general
tutorial (recommended place to start using Gnuastro), please see the
links below respectively:

https://www.gnu.org/s/gnuastro/manual/html_node/Gnuastro-library.html
https://www.gnu.org/s/gnuastro/manual/html_node/Gnuastro-programs-list.html
https://www.gnu.org/s/gnuastro/manual/html_node/General-program-usage-tutorial.html

For a complete review of the new/changed features in this release,
please see [1] below (also available in the 'NEWS' file within the
source code tarball).

Here is the compressed source and the GPG detached signature for this
release. To uncompress Lzip tarballs, see [2]. To check the validity
of the tarballs using the GPG detached signature (*.sig) see [3]:

  https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.16.tar.lz    (3.7MB)
  https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.16.tar.gz    (5.9MB)
  https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.16.tar.gz.sig (833B)
  https://ftp.gnu.org/gnu/gnuastro/gnuastro-0.16.tar.lz.sig (833B)

Here are the SHA1 and SHA256 checksums (other ways to check if the
tarball you download is what we distributed). Just note that the
SHA256 checksum is base64 encoded, instead of the hexadecimal encoding
that most checksum tools default to.

fe1f84bf1be270f1a62091e9a5f89bb94b182154  gnuastro-0.16.tar.lz
B4hftfYuyc7x3I6aEJ2SQlkp6x7zOOrPz/bK2koGuR8  gnuastro-0.16.tar.lz
1ae00673648fe8db5630f1de9d70b49fadb42d7d  gnuastro-0.16.tar.gz
kMEdJbsFrRNxDLX4EXntgXNgikJv3/2LIEWGLV/e4i0  gnuastro-0.16.tar.gz

For this release, Pedram Ashofteh Ardakani, Natáli D. Anzanello,
Sepideh Eskandarlou, Raúl Infante-Sainz, Vladimir Markelov and Zahra
Sharbaf directly contributed to the source of Gnuastro, I am very
grateful to all of them. I should also thank Alejandro Serrano
Borlaff, Fernando Buitrago, Mark Calabretta, Zohreh Ghaffari, Giulia
Golini, Leslie Hunt, Raúl Infante-Sainz, Matthias Kluge, Juan Miro,
Juan Molina Tobar, Markus Schaney, Zahra Sharbaf, Vincenzo Testa,
Ignacio Trujillo and Aaron Watkins for their very good suggestions or
bug reports that have been implemented in Gnuastro 0.16.

If any of Gnuastro's programs or libraries are useful in your work,
please cite _and_ acknowledge them. For citation and acknowledgment
guidelines, run the relevant programs with a `--cite' option (it can
be different for different programs, so run it for all the programs
you use). Citations _and_ acknowledgments are vital for the continued
work on Gnuastro, so please don't forget to support us by doing so.

This tarball was bootstrapped (created) with the tools below. Note
that you don't need these to build Gnuastro from the tarball, these
are the tools that were used to make the tarball itself. They are only
mentioned here to be able to reproduce/recreate this tarball later.
  Texinfo 6.8
  Autoconf 2.71
  Automake 1.16.4
  Help2man 1.48.5
  ImageMagick 7.1.0-9
  Gnulib v0.1-4944-g7fc3219bc
  Autoconf archives v2021.02.19-29-g0fbee2a

The dependencies to build Gnuastro from this tarball on your system
are described here:
  https://www.gnu.org/s/gnuastro/manual/html_node/Dependencies.html

Best wishes,
Mohammad
Read more