Draft

Decrypt me: function parser

Description:

During this kata, you will take on the role of a spy-decryptor.

Your commander has sent you on a dangerous mission to locate an envelope containing crucial information about your commander. Fortunately, an anonymous assistant from your enemy’s side has decided to help you and has sent you the envelope. However, the information inside is encrypted as an expression.

Your task is to decrypt the information inside.

Your are given a function as a string, for example:

'() => 1+2+3*4'

and your task is to provide the function with the same content

As you need to decrypt it as soon as possible, you can not recall how to use the follwoing methods (oh, what a poor memory):

  1. require
  2. eval
  3. Function
  4. and some regexp methods

Input

string as a function

Output

function itself (do not call it)

Restricted
Puzzles

Stats:

CreatedNov 10, 2024
Warriors Trained13
Total Skips0
Total Code Submissions25
Total Times Completed6
JavaScript Completions6
Total Stars1
% of votes with a positive feedback rating33% of 3
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes1
Total Rank Assessments2
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • Rcinos Avatar
Ad