Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
123
rated 0 times [  128] [ 5]  / answers: 1 / hits: 69725  / 12 Years ago, tue, april 24, 2012, 12:00:00

Is there any particular advantage/disadvantage in JavaScript memory consumption between using location.href = url as opposed to location.assign(url)?



I guess I'm wondering if it takes more memory to access the method as opposed to setting the property.


More From » javascript

 Answers
9

I always used and never had problems with:



location.href = url;


Calling a function should be slightly slower than accessing the property, but in terms of memory there should not be a big difference in my humble opinion.


[#86006] Monday, April 23, 2012, 12 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaredsages

Total Points: 273
Total Questions: 97
Total Answers: 105

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
1 Year ago
jaredsages questions
;