You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Discourage Array#reduce for this particular solution, because it creates a lot of intermediary strings (more than the split approach), except if the rest of the solution is correct (then you can mention it but approve). Using reduce requires more interpretation by the reader to follow, change and maintain.
Discourage String#substring with foreach iteration, because character iteration via split('') is more idiomatic and maintainable than substring with 1. Using split('') requires less interpretation by the reader to follow, change and maintain.
Approach
The suggested approach is to:
detect which type of solution it is (switch, map, or for/forEach)
make sure the optimal solution is correctly handled. You can use the batch runner to generate output for all fixtures.
go from there by adding paths to disapprove.
The text was updated successfully, but these errors were encountered:
This issue is for discussion and assignment for the
rna-transcription
core exercise in thejavascript
track.🔗 implementation | mentor-notes | problem-specification
This exercise focuses on
String
iteration (String#replace
,String#split
)Object
/Map
Optimal solution
Variations include
Set
orMap
with#get
, which are valid!Variations (approvable without comment)
String destructuring can also be used:
String#replace can also be used:
Variations include replacing only the "known" nucleotides:
Helper function variation
Instead of an anonymous function, a helper function may be used:
This also allows for a version without a mapping object:
SHOULD comment and disapprove
Cases we SHOULD comment on with this analyzer:
Object
to keep track of the mapping instead of conditionals.String#split
orString#replace
instead of usingfor
/forEach
withArray#push
Array#reduce
for this particular solution, because it creates a lot of intermediary strings (more than thesplit
approach), except if the rest of the solution is correct (then you can mention it but approve). Usingreduce
requires more interpretation by the reader to follow, change and maintain.String#substring
with foreach iteration, because character iteration viasplit('')
is more idiomatic and maintainable thansubstring
with 1. Usingsplit('')
requires less interpretation by the reader to follow, change and maintain.Approach
The suggested approach is to:
batch
runner to generate output for all fixtures.The text was updated successfully, but these errors were encountered: