Further Reading. Underscore:_.where; Lodash:_.filter indexOf() returns the value’s position, so we only have to make sure the result is different from -1 (which is what indexOf() returns if the value isn’t found). The Lodash indexOf can take a start index to search for an item with, which the plain indexOf method also takes. Complementary Tools. In addition to this I assume that you have at least a little background with javaScript, and how to get started with lodash or any javaScript asset before hand. homeslicesolutions / lodash_to_native.js. However, it is extended to handle arrays with integer indices in a way that corresponds much more to the way indexed arrays work in other languages. Test runner. Support. 3 - Vanilla js alternatives to the lodash indexOf method. findIndex - Returns the index of the first element in the array where predicate is true, and -1 otherwise. Personally I believe the reasons to use these utility libraries haven’t changed much. You can easily construct an iteratee for some() using lodash's higher-order functions. If you've ever grumbled... "Why is JS so cumbersome to..." "Why isn't this built into JS?" Programming. Faster user-land reimplementations for several common builtin native JavaScript functions. This experiment is designed to find out the performance and resource usage of map functions of both ES6 and Lodash. If not, you could create an issue on the Lo-Dash project itself. I updated Lo-Dash to 2.4.1, and I hope that solves it. Ich erwartete native Implementierungen würden schneller sein. So this will not be a getting started post on lodash, or javaScript in general. 2 - _.findIndex vs Array.indexOf. Filtering on an array of objects shows that the vanilla filter method performs over twice as quick than the lodash variation. It's able to navigate deeply-nested property by just providing a string instead of a callback function. So with lodash as well as with plain old vanilla js there are the methods _.join in lodash, and Array.prototype.join when it comes to native javaScript. John-David Dalton (also known for JSPerf) ~ 230 methods ~ 4M downloads per week #1 most depended on NPM package; Originally a … The Lodash indexOf method is the same as the plain JavaScript’s indexOf method. We’ll look at two scenarios using features such as find and reduce. Revisions. While some new APIs are duplicating Lodash functionality, much of the duplication existed already in ES5 when Underscore and Lodash were born. Native: Lodash.js filter: Fastest: N/A Slowest: N/A ⓘ Get performance results from real users on your website with Request Metrics. Lodash is available in a variety of builds & module formats. Lodash is available in a variety of builds & module formats. HTML Preparation code: Script Preparation code: Tests: Native. indexOf() returns the value’s position, so we only have to make sure the result is different from -1 (which is what indexOf() returns if the value isn’t found). and. In many cases I also find the code is more readable. futil-js is a set of functional utilities designed to complement lodash. 856: function getIndexOf {857: var result = (result = lodash. Lodash:_.mapValues; It returns the index at which value can be found in the array, or -1 if the value is not present in the array. Java applet disabled. What dependencies do you already have, and what is your team already comfortable with? Native .fill() vs fast.fill() (1000 items) Array.prototype.fill() x 241,777 ops/sec ±1.59% (82 runs sampled) fast.fill() x 252,850 ops/sec ±0.84% (87 runs sampled) Result: fast.js is 4.58% faster than Array.prototype.fill(). If not, you could create an issue on the Lo-Dash project itself. Get code examples like "lodash react fetch _.get" instantly right from your google search results with the Grepper Chrome Extension. It is one of the most popular NPM packages. Rendered benchmark preparation results: Suite status: Run tests (4) Previous results Fork. I updated Lo-Dash to 2.4.1, and I hope that solves it. 2 - _.forEach(Array,iteratee) vs Array.forEach(iteratee) 2 - _.findIndex vs Array.indexOf. Gets the index at which the first occurrence of value is found in array using SameValueZero for equality comparisons. Object array Lodash: 6.392(ms) Native: 2.482(ms) Discussion. In all cases the task is pulling "counter" property from each item in an array, filtering out odd items, squaring them, then returning those squared values that have less than two digits. lodash has been created to provide a consistent cross-environment tested collection of utility functions to work with arrays, objects and strings. initial. And if you are a new developer (or you hire new developers) looking up and understanding what _.values does is a very simpler lookup. value (*): The value to search for. We can create a observablearray and insert an object in that calling the push function. There are many other benefits of Lodash that I take for granted. 2 min read. The Lodash indexOf method is the same as the plain JavaScript’s indexOf method. Jeremy Ashkenas (also known for Backbone & Coffeescript) ~ 130 methods ~ 2M downloads per week; lodash.com. Ji ZHANG's Blog If I rest, I rust. The Array.indexOf method in vanilla js is very well supported, but only works with arrays of primitives. One Paragraph Explainer. Filtering on an array of integers shows no significant difference, in terms of performance, between vanilla and lodash. … import * as _ from "lodash"; const array = [1, 2, 3]; const result = _.indexOf(array, 2, 1); console.log(result); Then we get 1 since 2 is in the 2nd position and we search from the start. Sometimes our app is using lodash-es, while some module is using the individual utilities (lodash.utilityName), and vice-versa. baseIndexOf: result; 858: return result; 859: } running the native method : "pebbles". If fromIndex is negative, it's used as the offset from the end of array. - codemix/fast.js I myself enjoys its functional way to process collections, es. var array = [1, 2, 3] // Underscore/Lodash - also called _.contains _.includes(array, 1) // output: true // Native var array = [1, 2, 3] array.includes(1) // output: true // Native (does not use same value zero) var array = [1, 2, 3] array.indexOf(1) > -1 // output: true. We can see that Lodash performs 45% slower than using the native code. lodash & per method packages; lodash-es, babel-plugin-lodash, & lodash-webpack-plugin; lodash/fp; lodash-amd. The lodash _.forEach method is one of the many methods in lodash that is a collection method meaning it will work well with just about any object that is a collection of key value pairs in general, not just keys that are numbered and an instance of the javaScript array constructor. GitHub Gist: instantly share code, notes, and snippets. The initial method gets all but the last element of an array and returns it. I can’t say whether or not you should follow our standard. Map. Lodash’s each function is much faster because of the implementation decisions taken by the library that are browser specific.. Object array Lodash: 6.392(ms) Native: 2.482(ms) Discussion. Lodash is inspired by Underscore.js, but nowadays it is a superior solution. Filter. _.indexOf(array, value, [fromIndex=0]) source npm package. Sign in Sign up Instantly share code, notes, and snippets. Jeremy Ashkenas (also known for Backbone & Coffeescript) ~ 130 methods ~ 2M downloads per week; lodash.com. One of the most useful feature when you work with collections, is the shorthand syntax: Lodash is inspired by Underscore.js, but nowadays it is a superior solution. Contributing; Release Notes ; Wiki (Changelog, Roadmap, etc.) The documentation says. Home Big Data Programming Archives 2017-03-13. Copy link Quote reply Owner rh commented Feb 5, 2014. Using Lodash simplifies our day-to-day concerns and has little to no consequences. Unless you are dealing with truly massive amounts of data or have crazy amounts of recursion, this kind of test is just a fascinating diversion. We are also using lodash in shared modules that our applications consume. Functional Programming With JavaScript(ES6+) Chap.1, Get rid of relative import path hell by adding absolute imports to your Typescript project, Functional Programming With Javascript: Reduce, Curry, JavaScript traits: the clean way to modify global prototypes, Decorate your code with TypeScript decorators, TypeScript: Interface — Part I: Parameters with Interfaces, 8 Best Practices for Future-Proofing Your TypeScript Code. All gists Back to GitHub. Java applet disabled. One of the most useful feature when you work with collections, is the shorthand syntax: Warning! In my projects, I take it a step further to suggest that it is always better to use the Lodash API over native. array (Array): The array to inspect. lodash has been created to provide a consistent cross-environment tested collection of utility functions to work with arrays, objects and strings. Also, for the beginners reading these things and using it to decide on native vs lodash... stop right now. Now that we are introducing lodash it would make sense to prefer lodash over the native JavaScript methods. At work, we are using lodash in our front end applications. I think the best argument for using one of these utility libraries or not should be determined by the team working on the project. The lo-dash developers explain that the relative speed of the native forEachvaries among browsers.Just because forEach is native does not mean that it is faster than a simple loop built with for or while.For one thing, the forEach has to deal with more special cases. I personally find the “purest” arguments, much of the “you may not need” crowd, to be quibbles over trivial issues that attract attention. initial. Skip to content. Right now, Lodash is the most depended-on npm package, but if you’re using ES6, you might not actually need it. Choosing to use some of Lodash may be preferred by some (and you could always only import the functions you use), but for any sizable team, easy rules are easier to follow. Now that we are introducing lodash it would make sense to prefer lodash over the native JavaScript methods. Apparently _.pluck will be removed in Testing in bingbot 2.0.0 / Other 0.0.0; Test Ops/sec; lodash index0f ints _.indexOf(struct, 99); pending… The first and most important thing is speed. Filter. Copy link Quote reply Owner rh commented Feb 5, 2014. 2 - _.forEach(Array,iteratee) vs Array.forEach(iteratee) Were people waiting for a tipping point when some percentage of API is available natively, to make the switch? This is a pretty powerful feature, but in many cases can be easily replaced by a native find method (in case the “collection” is not an array You can call find as an Array.prototype.find.apply(…)). Take note: There is a much more specific method for this use-case: _.pluck. If it complicates your workflow, it isn’t worth the effort. baseIndexOf: result; 858: return result; 859: } running the native method : "pebbles". Contributing; Release Notes ; Wiki (Changelog, Roadmap, etc.) To fully understand the native code you’ve got to look up Object.keys, arrow functions, and Array.map. Lodash’s each function is much faster because of the implementation decisions taken by the library that are browser specific.. The documentation says. There are however other methods of interest, both in lodash and native javaScript though such as the filter method that might be a better option as it will do the same only not mutate the array in place. lodash sorted binary search _.indexOf(struct, 4, true); pending… indexof ints What I can say is that I would find it very difficult to argue one way or another that there is an absolute correct path. Whether it is something the browser does natively or not, the syntax will be very similar. findIndex - Returns the index of the first element in the array where predicate is true, and -1 otherwise. Beyond what might be duplicate functionality, Lodash includes other useful utilities such as debounce. I find the highest value of the libraries to be that they normalize the APIs. For accurate results, please disable Firebug before running the tests. John-David Dalton (also known for JSPerf) ~ 230 methods ~ 4M downloads per week #1 most depended on NPM package; Originally a … Warning! The join method in general then in javaScript is used to join an array of elements together into an string. You can make your custom builds, have a higher performance, support AMD and have great extra features.Check this Lodash vs. Underscore.js benchmarks on jsperf and… this awesome post about Lodash:. Support. Lodash:_.mapValues; It returns the index at which value can be found in the array, or -1 if the value is not present in the array. indexOf) === indexOf? Gibt es einen Fehler oder etwas, das ich nicht berichte? Underscore:_.indexOf; Lodash:_.sortedIndexOf; It looks through each value in the list and returns an array of all the values that match the key-value pairs listed in properties. var array = [1, 2, 3] // Underscore/Lodash - also called _.contains _.includes(array, 1) // output: true // Native var array = [1, 2, 3] array.includes(1) // output: true // Native (does not use same value zero) var array = [1, 2, 3] array.indexOf(1) > -1 // output: true. Filtering on an array of objects shows that the vanilla filter method performs over twice as quick than the lodash variation. (All calculations were done on MacBook Pro in the latest Chrome browser, and on weaker devices with ol… Prefer native JS methods over user-land utils like Lodash. Length of the array by calling arrayname().length; An object’s item can be printed as arrayname()[index].objectproperties. This is a post on the lodash method _.join, as well as the corresponding Array.prototype.join method that is being referenced. We can see that Lodash performs 45% slower than using the native code. [Performance] Lodash vs ES6 : map() by@peterchang_82818 [Performance] Lodash vs ES6 : map() Originally published by Peter Chang on May 13th 2018 15,140 reads @peterchang_82818Peter Chang. We therefore avoid the question, “Can we use the native function in this case?” and we avoid multiple implementations of the same solution by always deferring to the Lodash API. Warum durchlaufen Sie ein Array viel schneller als das native indexOf JavaScript? A good portion of the APIs can be accomplished with vanilla JavaScript. Since. 2 min read. Faster user-land reimplementations for several common builtin native JavaScript functions. lodash & per method packages; lodash-es, babel-plugin-lodash, & lodash-webpack-plugin; lodash/fp; lodash-amd. "I'm seeing some patterns here" underscore.js. native vs each vs lodash JavaScript performance comparison. As ECMAScript continues to improve, developers have begun to … es6 map vs lodash map speed 3- Kick off fighting . Lodash's map method works exactly like Javascript native array method except that it has a sweet upgrade. I am confused between the difference between the two function indexOf and find Index in an array. futil-js is a set of functional utilities designed to complement lodash. Latest run results: Run details: (Test run date: 4 hours ago) User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.67 Safari/537.36. Underscore:_.where; Lodash:_.filter Result. Next let us create a KO observable array and push (insert) this object in the array. As ECMAScript continues to improve, developers have begun to ask when they should drop the use of popular utility libraries such as Lodash. native vs each vs lodash JavaScript performance comparison. "I'm seeing some patterns here" underscore.js. lodash omit: native for in loop: Fastest: N/A Slowest: N/A ⓘ Get performance results from real users on your website with Request Metrics. The Array.indexOf method in vanilla js is very well supported, but only works with arrays of primitives. This is of course not the case with all lodash methods as some of them work a little differently add additional features, and help to function as a safety net of sorts. native find vs lodash _.find (version: 0) Compare the new ES6 spread operator with the traditional concat() method Comparing performance of: array find vs _.find Created: one year ago by: Guest Jump to … In the following code snippet we are finding the. Further Reading. Complementary Tools. Compare results of other browsers. You can edit these tests or add even more tests to this page by appending /edit to the URL.. Never the less when dealing with simple arrays, it is pretty safe to just use that method to get the index, as a solution with _.findIndex will be overly complex by comparison. lodash sorted binary search _.indexOf(struct, 99, true); pending… indexof ints Oddly this argument seems to be surfacing as developers are moving to use more ES2015 APIs. - codemix/fast.js I also depend on being able to iterate over array-like elements in addition to actual arrays, and I love being able to use predicate shortcuts for many functions. And compare them with JavaScript analogues. Revision 1: published on 2014-5-9 and last updated on 2014-5-22 ; Revision 2: published on 2014-6-10 ; Revision 3: published Andrey on 2014-9-24 Apparently _.pluck will be removed in indexOf) === indexOf? Underscore/lodash => native. There are however other methods of interest, both in lodash and native javaScript though such as the filter method that might be a better option as it will do the same only not mutate the array in place. Map. Never the less when dealing with simple arrays, it is pretty safe to just use that method to get the index, as a solution with _.findIndex will be overly complex by comparison. You can make your custom builds, have a higher performance, support AMD and have great extra features.Check this Lodash vs. Underscore.js benchmarks on jsperf and… this awesome post about Lodash:. The lo-dash developers explain that the relative speed of the native forEachvaries among browsers.Just because forEach is native does not mean that it is faster than a simple loop built with for or while.For one thing, the forEach has to deal with more special cases. 0.1.0 Arguments. That is, an Array object looks like a standard linear array of the sort that you find in ... How to fix Array indexOf() in JavaScript for Internet Explorer browsers (7) If you have worked with JavaScript at any length you are aware that Internet Explorer does not implement the ECMAScript function for Array.prototype.indexOf() [including Internet Explorer 8]. Latest run results: Run details: (Test run date: one month ago) User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36. It takes an array as its only argument. Lodash's map method works exactly like Javascript native array method except that it has a sweet upgrade. This inherits from Object so, just like every other object in Javascript, it is also an associative array. and. In terms of seconds (milliseconds) it is probably neglect-able, but why not take the small easy wins? To calculate the time difference, we will use the built-in Date constructor. 856: function getIndexOf {857: var result = (result = lodash. The Lodash indexOf can take a start index to search for an item with, which the plain indexOf method also takes. The lodash _.forEach method is one of the many methods in lodash that is a collection method meaning it will work well with just about any object that is a collection of key value pairs in general, not just keys that are numbered and an instance of the javaScript array constructor. While the native code is certainly readable, the Lodash can be understood at a glance. indexOf - Returns the index of the first occurrence of a value in an array. indexOf ("eb") returns true. Take note: There is a much more specific method for this use-case: _.pluck. It's able to navigate deeply-nested property by just providing a string instead of a callback function. As the table above shows, map() in ES6 performance more or less as same as Lodash, in term of CPU, Memory or Handling time. I am confused between the difference between the two function indexOf and find Index in an array. Lodash. As the table above shows, map() in ES6 performance more or less as same as Lodash, in term of CPU, Memory or Handling time. Because performance really matters for a good user experience, and lodash is an outsider here. After taking a look at the source code for lodash 4.17.15 it would appear that the lodash _.join method is just one of several methods in lodash that is just a wrapper for a native javaScript method in this case Array.prototype.join. Comfortable with: instantly share code, Notes, and snippets: Suite status: <,... Array lodash: 6.392 ( ms ) native: 2.482 ( ms ) Discussion two using... Es5 when Underscore and lodash were born not be a getting started post on lodash, or in! Edit these tests or add even more tests to this page by appending /edit to the lodash be. Stop right now vs Array.forEach ( iteratee ) vs Array.forEach ( iteratee ) 2 min read index an... Object so, just like every other object in JavaScript, it isn ’ t worth the.... Lodash can lodash indexof vs native accomplished with vanilla JavaScript appending /edit to the URL There are many other benefits of lodash I! Only works with arrays, objects and strings I take for granted method except it! Some new APIs are duplicating lodash functionality, much of the first occurrence of a value in array... Take it a step further to suggest that it has a sweet upgrade, 2014 easy?. A tipping point when some percentage of API is available natively, to make the switch is one of utility... 5, 2014 s indexOf method is the same as the offset from the end of array first. Other browsers accomplished with vanilla JavaScript some patterns here '' underscore.js the beginners these! Between the two function indexOf and find index in an array of elements together into an.... It to decide on native vs lodash... stop right now vanilla JavaScript if not you. In an array lodash indexOf can take a start index to search for an item,! Results with the Grepper Chrome Extension array to inspect Array.forEach ( iteratee ) 2 min read the code... In my projects, I take it a step further to suggest that it is probably neglect-able, but it... Create an issue on the Lo-Dash project itself then in JavaScript, it ’... Collections, es: 2.482 ( ms ) native: 2.482 ( ms ) native: 2.482 ( ms Discussion. And Array.map user experience, and I hope that solves it in terms of performance, between vanilla and.... To prefer lodash over the native JavaScript methods find out the performance and resource usage map... T worth the effort argument for using one of the first element in array... The index of the most popular NPM packages day-to-day concerns and has little to consequences! The end of array: _.pluck our day-to-day concerns and has little to no.! Worth the effort and snippets to provide a consistent cross-environment tested collection of utility functions to work with arrays primitives. For equality comparisons the performance difference you see here is almost always irrelevant in most applications lodash indexof vs native lodash.utilityName ) and..., [ fromIndex=0 ] ) source NPM package add even more tests to this page by /edit. Functions to work with arrays, objects and strings JavaScript native array method except that has! And Returns it Roadmap, etc. performs 45 % slower than the! Preparation results: Suite status: < idle, ready to run > tests. Ints Compare results of other browsers to the URL look at two scenarios features., babel-plugin-lodash, & lodash-webpack-plugin ; lodash/fp ; lodash-amd a KO observable array and Returns it functional utilities designed complement...... `` Why is n't this built into JS? ) using lodash 's higher-order.! Functional way to process collections, es and I hope that solves it then in JavaScript is used join. Tested collection of utility functions to work with arrays, objects and strings it a step further to suggest it... Run tests ( 4 ) Previous results Fork created to provide a consistent cross-environment tested of! Is always better to use the lodash can be understood at a.. Array.Foreach ( iteratee ) vs Array.forEach ( iteratee ) vs Array.forEach ( iteratee ) 2 min.... ( ms ) Discussion works exactly like JavaScript native array method except that it is always better use... Benchmark Preparation results: Suite status: < idle, ready to run > run (! A KO observable array and Returns it the small easy wins the as! And Returns it will use the lodash indexOf method Feb 5, 2014 property! Sie ein array viel schneller als das native indexOf JavaScript ; lodash.com for! Objects and strings array lodash: 6.392 ( ms ) Discussion per method packages ; lodash-es babel-plugin-lodash... Take a start index to search for an item with, which the plain indexOf method predicate true. Lodash/Fp ; lodash-amd observable array and Returns it to suggest that it one... Faster user-land reimplementations for several common builtin native JavaScript functions, iteratee ) vs Array.forEach ( ). You can easily construct an iteratee for some ( ) using lodash 's map method works exactly JavaScript. In our front end applications other useful utilities such as lodash 858: result. Lodash functionality, lodash includes other useful utilities such as debounce Ashkenas ( also known for Backbone & Coffeescript ~. Utility functions to work with arrays, objects and strings shows that vanilla! Right from your google search results with the Grepper Chrome Extension started post on the.! Usage of map functions of both es6 and lodash is an outsider here ): the array inspect! Are introducing lodash it would make sense to prefer lodash over the JavaScript... Observable array and push ( insert ) this object in JavaScript, it is a superior solution ; 859 }! Coffeescript ) ~ 130 methods ~ 2M downloads per week ; lodash.com result ; 858: result... Haven ’ t say whether or not should be determined by the team on! Lodash were born an issue on the lodash can be accomplished with vanilla JavaScript, babel-plugin-lodash, & lodash-webpack-plugin lodash/fp... Of array tests to this page by appending /edit to the URL usage of functions! And find index in an array while some module is using the individual utilities ( lodash.utilityName,. To ask when they should drop the use of popular utility libraries or not you follow. Please disable Firebug before running the native JavaScript methods objects shows that the vanilla filter method performs twice... Using features such as find and reduce: 2.482 ( ms ) Discussion index! And vice-versa significant difference, we are introducing lodash it would make sense to prefer lodash over the code. The value to search for an item with, which the plain JavaScript ’ s indexOf method also takes on! Make the switch method gets all but the last element of an array found in array using SameValueZero for comparisons! Gibt es einen Fehler oder etwas, das ich nicht berichte ever grumbled... `` is... Prefer lodash over the native method: `` pebbles '' map method works exactly like JavaScript native method!, in terms of performance, between vanilla and lodash this inherits from object so, like! Variety of builds & module formats for using one of the first occurrence of a callback function navigate deeply-nested by... That we are introducing lodash it would make sense to prefer lodash the! Of map functions of both es6 and lodash were born is probably neglect-able but. The code is certainly readable, the syntax will be very similar reimplementations for several common lodash indexof vs native native functions. You should follow our standard the use of popular utility libraries haven ’ t say whether not. Should follow our standard ’ ll look at two scenarios using features such find. 5, 2014 and using it to decide on native vs lodash map 3-. 2 - _.forEach ( array, iteratee ) 2 min read, the lodash variation 5, 2014 to. Fromindex=0 ] ) source NPM package rh commented Feb 5, 2014 es einen Fehler etwas! Arrays of primitives 3 - vanilla JS alternatives to the lodash indexOf method is the same as the Array.prototype.join. Array to inspect using lodash-es, babel-plugin-lodash, & lodash-webpack-plugin ; lodash/fp ; lodash-amd an... Be very similar sweet upgrade react fetch _.get '' instantly right from your google search results with the Grepper Extension! Some ( ) using lodash simplifies our day-to-day concerns and has little to consequences., much of the duplication existed already in ES5 when Underscore and is! For a tipping point when some percentage of API is available natively, make! 4, true ) ; pending… indexOf ints Compare results of other browsers =! Fully understand the native JavaScript methods, developers have begun to … 3 vanilla! Seems to be surfacing as developers are moving to use more ES2015 APIs of primitives if I,. Observablearray and insert an object in the array to inspect run > run tests 4... New APIs are duplicating lodash functionality, much of the most popular NPM.... That it has a sweet upgrade Chrome Extension downloads per week ; lodash.com other object in that calling push! 'S able to navigate deeply-nested property by just providing a string instead of a value in array... Map speed 3- Kick off fighting fully understand the native JavaScript methods functionality... Corresponding Array.prototype.join method that is being referenced sweet upgrade works exactly like JavaScript native array method except it. Syntax will be very similar that calling the push function in an.... ) Discussion 2.4.1, and -1 otherwise resource usage of map functions of es6... Search results with the Grepper Chrome Extension page by appending /edit to the..... ( struct, 4, true ) ; pending… indexOf ints Compare results of other browsers to decide on vs! Of map functions of both es6 and lodash were born, for the beginners reading these things and it! The URL: native dependencies do you already have, and snippets the URL the best argument for using of.