Collect.js dd() Method
Last Updated :
29 Jul, 2020
The dd() method in collect.js is used to log the output of the function and stop the further execution thus exiting the current process.
Installation:
- Using NPM:
npm install collect.js
Syntax:
collect.dd()
Parameters: It does not accept any parameters.
Return Value: It does not return anything.
Example 1:
Javascript
const collect = require( 'collect.js' );
let array = [1, 2, 3, 4, 5, 6];
let collection = collect(array);
collection.dd();
|
Output:
Example 2: Code after dd() function will not be executed.
Javascript
const collect = require( 'collect.js' );
let array = [ "a" , "b" , "c" ];
let collection = collect(array);
console.log( "Output is: " );
collection.dd();
console.log( "geeks for geeks" );
|
Output:
Reference: https://collect.js.org/api/dd.html
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...