1

I'm attempting to create a function over multiple lines. Parameters of the challenge: function returns 'barbarian' and only 2 characters per line. I keep trying to use a fat arrow to declare my function, but fat arrows don't seem to work if you don't have them connected.

My current work:

f=
(
)=>

'\
b\
a\
r\
b\
a\
r\
i\
a\
n\
s\
'

This works, but the ')=>' is 3 characters long. I really just want to know how it is possible to even stretch out the creation of a function. I can't find any info on it anywhere as it's obviously not very practical.

3
  • 3
    Seems like a better match for Code Golf than Stack Overflow... Commented Mar 2, 2018 at 22:53
  • I'm voting to close this question as off-topic because it is not a practical, answerable problem that is unique to software development. Commented Mar 3, 2018 at 1:55
  • 1
    @JoKing Fair enough. The OP probably should have read the help center on both sites... Commented Mar 3, 2018 at 1:56

2 Answers 2

1

Here is what I did:

https://jsfiddle.net/wwr66653/5/

The code is too big to post, see fiddle

This was done using http://www.jsfuck.com/ It's not practical but neither is the question

Sign up to request clarification or add additional context in comments.

Comments

1

You might use constructor of any built-in method e.g. of Array.prototype.map:

f=
[]
[
'\
m\
a\
p'
][
'\
c\
o\
n\
s\
t\
r\
u\
c\
t\
o\
r'
](
"\
r\
e\
t\
u\
r\
n\
'\
b\
a\
r\
b\
a\
r\
i\
a\
n\
s\
'"
)
console.log(f())

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.