Home » Search results for 'javascript date'

How to Convert Array to String in JavaScript with toString() and join()

JavaScript Array to String

This brief tutorial will show you two ways to convert JavaScript arrays to strings using the toString() and join() methods. What Are Arrays? An array is a data structure which holds multiple values. It’s like a numbered list – each item in the array has a value and a position (called the index). The indexes start counting at position 0, so the first item in an array is at index 0, the second at index 1 and so on. Converting Arrays to Strings in JavaScript There are many reasons you may wish … Read more

Home » Search results for 'javascript date'

Copy/Clone an Array or Object in JavaScript The Right Way [Examples]

How to Copy/Clone JavaScript Array

This tutorial will show you how to properly copy/clone an array or object in JavaScript – it’s not as simple as it seems! Copying an array or object may seem simple – but JavaScript throws a spanner in the works – the fact that when you assign the value of one variable to another it references the original variable. This means that if the value of the original variable is changed, the value of the copy will change too! To get around this, you will need to clone the array – ensuring … Read more

Home » Search results for 'javascript date'

How to Write to a File Using JavaScript, With Examples

Write to File in JavaScript

This article will show you how to write to files from JavaScript – both from the web browser and Node.js environments. With examples on how to write, append, update, delete and rename files. JavaScript code is usually run from one of two environments – within a web browser when viewing a web page or in a Node.js environment which allows JavaScript to be executed outside of a web browser – commonly used for building back-end services and web apps. Write to a File From the Browser … Read more

Home » Search results for 'javascript date'

The Best Way to Declare an Array in JavaScript

JavaScript Declare Array

There are several ways to declare an array in JavaScript. This article will show you which is the best. What is an Array? An array is a type of variable that holds an ordered list of values. Each value has a position in the array, called the index. The index can be used to access each value in the array. Indexes are integer values, which start counting from 0 (zero) for the first item in the array. The Literal Constructor – Declaring an Array using Square Brackets (The Best … Read more

Home » Search results for 'javascript date'

JavaScript Libraries We’re Using to Build Apps in 2022

Javascript Libraries

JavaScript libraries take the legwork out of building complex applications. Here are some of the most useful libraries to use in 2021/2022. Once you’ve graduated from ‘Hello World!‘ and understand how JavaScript works, you’ll probably want to dive into building something more useful – a website, or a service, or a mobile app. These all have many moving parts – Authentication so users can log in, database support for storing data, file uploads so users can store their cat pictures in the database – all of these … Read more

Home » Search results for 'javascript date'

How to Filter Arrays in JavaScript, With Examples

Javascript: filter arrays

We’ve covered arrays in JavaScript pretty extensively on LinuxScrew. This article will show you how to use the filter method – with easy-to-follow examples. JavaScript Arrays Arrays are a type of variable that holds a list of other values or variables. They’re one of the fundamentals of computer programming. These lists contain items at positions (called indexes). These items can be anything – numbers, strings, complex objects – whatever you want to store. Arrays are super useful. You might use them to store the rows in a … Read more

Home » Search results for 'javascript date'

The Difference Between JavaScript and Node.js – Which Should I Use?

JavaScript vs Node JS

This article explains JavaScript and Node.js and their relationship with each other. What is JavaScript? JavaScript has become one of the most popular programming languages for building web applications and has even become a contender for building solid desktop and mobile applications. In the browser, there is no competitor – browsers run JavaScript for their client-side code- allowing them to pop up windows, disable buttons, animate screen elements, and retrieve data. This is what JavaScript was built for. What is it Good For? JavaScript Runs … Read more

Home » Search results for 'javascript date'

TypeScript Vs JavaScript – What’s the Difference & Which Should You Use?

TypeScript Vs JavaScript

This article will discuss the differences between typescript and JavaScript, the problems they solve, and which is best to use. I really like TypeScript, and I use it a lot. It solves so many of JavaScript’s problems and makes writing good JavaScript code much easier (once you’ve learned to use TypeScript). So, this article is more about why you should use TypeScript (when you can use it), when/where you can use it, and the problems it solves. This article goes well with the following articles, giving you an … Read more

Home » Search results for 'javascript date'

Assign Variables, Global Variables and Scopes in JavaScript (let, var, const)

JavaScript let var const

let, var, and const are all JavaScript statements that assign a value to a variable. Their behavior can differ depending on how and where they are used in your code – read on to find out the details. Scopes in JavaScript As you start to build more complex applications, you’ll start to see a lot of talk about scopes. A variable’s scope defines where it is available in your application. Global Scope (Global Variables) If a variable is in the global scope, it is available anywhere in your application. It can be called … Read more

Home » Search results for 'javascript date'

Removing an Element From an Array in JavaScript, with Examples

Removing an Element From an Array in JavaScript

There are multiple ways to remove an element from an array in Javascript. We cover all of the methods that can be used in this tutorial. JavaScript is a flexible programming language that runs just about everywhere. You can run JavaScript apps in web browsers, build command-line apps you can run in the terminal, mobile apps can be built using platforms like Cordova, and server processes can be written on platforms like Node.js. Naturally, Linux is the environment of choice for many JavaScript developers and … Read more