
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6710 Articles for Javascript

249 Views
In JavaScript, we can create functions that take other functions as arguments and invoke them with transformed arguments. This is a powerful technique that can be used to create higher−order functions, which can take a function and return a new function with different behavior. What are Transforming Function Arguments To transform function arguments, we can use the built−in methods map() and reduce(). These methods can be used on arrays to transform the elements in the array. We can use them on functions to transform the arguments that are passed to the function. The map() Method The map() method takes a ... Read More

176 Views
JavaScript functions can be invoked with or without arguments. When invoked with arguments, the function is executed with the arguments passed in as values. When invoked without arguments, the function is executed with no arguments passed in. In some cases, it is desirable to invoke a function with some arguments, but not all of them. This can be accomplished by using the Function.prototype.apply method, or by using the spread operator ( ... ). Using the Function.prototype.apply Method The Function.prototype.apply method can be used to invoke a function with some arguments, but not all of them. The first argument to the ... Read More

446 Views
In JavaScript, a function can be invoked by passing arguments to it. However, sometimes it is necessary to invoke a function with some arguments already filled in. This can be done using a technique called partial function application. What is Partial Function Application? Partial function application is a way to create a new function by "pre− filling" some of the arguments to an existing function. This is useful when you want to create a new function that is similar to an existing function, but with some arguments already set. For example, say you have a function that calculates the area ... Read More

5K+ Views
When working with JavaScript, you may find yourself needing to call a promise inside another promise. While this may seem like a daunting task, it is actually quite simple once you understand the basics of promises. In this article, we will discuss how to call a promise inside another promise in JavaScript. The Basics of Promises In order to understand how to call a promise inside another promise, it is important first to understand the basics of promises. A promise is an object that represents the eventual result of an asynchronous operation. Promises are used in JavaScript to handle asynchronous ... Read More

226 Views
In this tutorial, we are going to learn how to disable the centered rotation of Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. By default all objects in FabricJS use their center as the point of rotation. However, we can change this behaviour by using the centeredRotation property. Syntax new fabric.Text(text: String, ... Read More

295 Views
In this tutorial, we are going to create a Text with a dash pattern border using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can change the appearance of the dashes of border, by using the borderDashArray property. However, our text object must have borders in order for this property to work. If ... Read More

1K+ Views
In this tutorial, we are going to learn about how to create a canvas with a Text object using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. One difference between Text and Textbox is, Textbox is editable interactively while Text isn’t. Syntax new fabric.Text( text: String , options: Object) Parameters text − ... Read More

430 Views
In this tutorial, we are going to learn how to compute the height of line at required line index in Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can also compute the height of line at required line index by using the getHeightOfLine method. Syntax getHeightOfLine(lineIndex: Number) Parameters lineIndex ... Read More

458 Views
In this tutorial, we are going to see how to change the font weight of Text using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. Font weight refers to the value which determines how bold or light our text will appear. Syntax new fabric.Text(text: String , { fontWeight: Number|String }: Object) Parameters ... Read More

413 Views
In this tutorial, we are going to learn about how to change the font style in Text object using FabricJS. We can display text on canvas by adding an instance of fabric.Text. Not only does it allow us to move, scale and change the dimensions of the text but it also provides additional functionality like text alignment, text decoration, line height which can be obtained by the properties textAlign, underline and lineHeight respectively. We can change the font style by using the fontStyle property. Syntax new fabric.Text(text: String, { fontStyle: String }: Object) Parameters text − This parameter ... Read More