Skip to content

Commit

Permalink
added func
Browse files Browse the repository at this point in the history
  • Loading branch information
helga16 committed Nov 13, 2024
1 parent feda5af commit 267f069
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/convertToObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@
* @return {object}
*/
function convertToObject(sourceString) {
// write your code here
const arrayWithStyles = complexStylesString.split(';')

Check failure on line 9 in src/convertToObject.js

View workflow job for this annotation

GitHub Actions / build (20.x)

'complexStylesString' is not defined
.map((el) => el.trim());
const resultObject = {};

for (const el of arrayWithStyles) {

Check failure on line 13 in src/convertToObject.js

View workflow job for this annotation

GitHub Actions / build (20.x)

'el' is already declared in the upper scope on line 12 column 14
const pair = el.split(':').map((el) => el.trim());
resultObject[pair[0]] = pair[1];
}

return resultObject;
}

module.exports = convertToObject;

0 comments on commit 267f069

Please sign in to comment.