6 kyu

Object Search and Replace

488 of 493tencircles

Description:

Given an object with an arbitrary number of properties, any number of which may be objects or arrays, replace all values which are strictly equal to the string: "dynamic" with a given string occurring anywhere in that object or a child object or array.

Your solution should be recursive.

Your solution should be "in place" meaning it return the original object, not a copy.

Your solution should also include some type safety. If a value that isn't an object or array is passed as the first argument, it should just return whatever was passed in.

Algorithms

Stats:

CreatedSep 26, 2013
PublishedSep 26, 2013
Warriors Trained1248
Total Skips178
Total Code Submissions2917
Total Times Completed493
JavaScript Completions488
Total Stars31
% of votes with a positive feedback rating90% of 115
Total "Very Satisfied" Votes98
Total "Somewhat Satisfied" Votes12
Total "Not Satisfied" Votes5
Ad
Contributors
  • tencircles Avatar
  • jhoffner Avatar
  • joh_pot Avatar
  • Souzooka Avatar
Ad