
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

458 Views
Props are properties that help to modify the react component. The component created can be used with different parameters using props concept. With props you can pass the information from one component to another and at the same time re-use the component as per your requirement.You will be familiar with props if you are well versed with ReactJS, the same concepts follow in React Native.Let us take a look at an example that explains what props are.Example 1: Props inside React Native Built-in ComponentsConsider the Image component −The style and source are properties i.e props for the image component. The ... Read More

2K+ Views
State is the place where the data comes from. We should always try to make our state as simple as possible and minimize the number of stateful components. If we have, for example, ten components that need data from the state, we should create one container component that will keep the state for all of them.Example 1Button title changing to ON/OFF when the user presses the button.The state is initialized inside the constructor as shown below −constructor(props) { super(props); this.state = { isToggle: true }; }The isToggle is the boolean value given to the state. The title of ... Read More

446 Views
The most important core components in react native are as follows −React Native componentAndroid Native ViewIOS Native ViewWeb BrowserDescriptionView - When the app is seen in Android device the component will be changed to when the app is seen in IOS device the component will be changed to When seen in a web browser the component will be changed to tagIt is the core container that supports flexbox layout. It also manages touch handling.Text - When the app is seen in Android device the component will be changed to when the app is seen in ... Read More

1K+ Views
React Native is an open source JavaScript Mobile framework from Facebook specially designed to build native mobile apps for iOS and Android. React Native is based on ReactJS JavaScript library that helps to build the user interface for mobile platforms.React Native can be directly used inside an existing IOS or android app or you can build a native app right from scratch. At present React Native is used with some popular apps like Facebook mobile app, Instagram, Pinterest, Skype, etc.Some important features of React Native that makes it a very popular mobile development app today are −Cross Platform Support − ... Read More

221 Views
The writable.writableObjectMode property is used for getting the objectMode property of the given writable Stream. The property will return 'true' if the object mode is set, else 'false' will be returned.Syntaxwriteable.writableObjectModeExampleCreate a file with name – writableObjectMode.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −node writableObjectMode.jswritableObjectMode.js Live Demo// Program to demonstrate writable.writableObjectMode property // Importing the stream module const stream = require('stream'); // Setting the objectMode to true objectMode: true // Creating a data stream with writable const writable = new stream.Writable({ ... Read More

238 Views
The writable.writableLength property is used for displaying the number of bytes or objects which are there in the queue that are ready to be written. This is used for inspecting the data as per the status from highWaterMark.Syntaxwriteable.writableLengthExample 1Create a file with name – writableLength.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −node writableLength.js Live Demo// Program to demonstrate writable.writableLength method const stream = require('stream'); // Creating a data stream with writable const writable = new stream.Writable({ // Writing the data from stream ... Read More

693 Views
The writable.cork() method is used for forcing all the written data to be buffered inside a memory. This buffered data will only be removed from the buffer memory after stream.uncork() or stream.end() method have been called.Syntaxcork()writeable.cork()uncork()writeable.uncork()ParametersSince it buffers the written data. Only parameter that's needed will be the writable data.ExampleCreate a file with name – cork.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −node cork.jscork.js Live Demo// Program to demonstrate writable.cork() method const stream = require('stream'); // Creating a data stream with writable const ... Read More

130 Views
The auth() property defines the username and password portion of any URL, also called as userInfo. The string and username are separated by a colon ( : ).SyntaxurlOject.auth()ParametersSince it retuns only the username and password from a URL, it does not required any input parameters.ExampleCreate a file with name – auth.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −node auth.jsauth.js Live Demo// Importing the URL module const url = require('url'); var adr = 'https://username=hello:password=tutorialspoint@www.tutorialspoint.com/'; // Parsing the above URL address var q = ... Read More

5K+ Views
The send() and json() functions are used for sending the response to the client directly from the server. The send() method will send the data in a string format, whereas the json() function will send the same in JSON format. The sendStatus() method is used for sending the HTTP request status with the client. Possible status values are: 200(Success), 404(Not found), 201(Created), 503(Server Unreachable) etc.PrerequisiteNode.jsExpress.jsInstallationInstall the express module using the below statement −npm install expressExample - sendStatus()Create a file with name – sendStatus.js and copy the below code snippet. After creating file, use the following command to run this code ... Read More

178 Views
The script.createCachedData() method is used for creating a code cache that will be used along with the cachedData option of the script constructor. This cachedData can be called multiple number of times without latency. This method is an inbuilt programming interface from the 'script' module.Syntaxscript.createCachedData()ParametersSince it only caches the data. It does not require any specific inputs from the user. It only returns the cached buffer.ExampleCreate a file with name – createCachedData.js and copy the below code snippet. After creating file, use the following command to run this code as shown in the example below −node createCachedData.jscreateCachedData.js// Node.js program to ... Read More