JS notation to Immutable.js notation
Now Immutable.js made its way into many frontends. This challenge consists of a typical refactoring that many of us are facing now.
Start file
lines[1][1] = 'hello' lines[2][0] = 'world' lines[3][1] = 'whats' lines[10][2] = 'going' lines[12][1] = 'on'
End file
lines .setIn([1, 1], 'hello') .setIn([2, 0], 'world') .setIn([3, 1], 'whats') .setIn([10, 2], 'going') .setIn([12, 1], 'on')
View Diff
1,5c1,6 < lines[1][1] = 'hello' < lines[2][0] = 'world' < lines[3][1] = 'whats' < lines[10][2] = 'going' < lines[12][1] = 'on' --- > lines > .setIn([1, 1], 'hello') > .setIn([2, 0], 'world') > .setIn([3, 1], 'whats') > .setIn([10, 2], 'going') > .setIn([12, 1], 'on')
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 62 remaining solutions by signing in and submitting your own entry
#63 Tim Suchanek / @TimSuchanek - Score: 78 - 01/22/16 @ 17:10
VG:s/lines\[\(.*\)\]\[\(.*\)\]\s=\s'\(.*\)'/<Tab>.setIn([\1, \2], '\3')<CR>{Olines<Esc>ZZ
0 comments