← 返回首页
JavaScript Algorithms | Menu

JavaScript Algorithms

Algorithms: Name Swap, Palindrome, Reverse String, Repeat String

By YunaAnn

Code Github profile

Reverse String

EXAMPLE

cat -> tac lovely -> ylevol
Reverse!

RESULT

------------

Alphabetize String

EXAMPLE

cat -> act rain -> ainr
Alphabetize!

RESULT

------------

Repeat String

EXAMPLE

cat, 5 -> catcatcatcatcat rain, 4' -> rainrainrainrain
Repeat!

RESULT

------------

Name Swap

EXAMPLE

Doe Jane -> Jane Doe Nowak Jan -> Jan Nowak
Swap!

RESULT

------------

Palindrome

EXAMPLE PALIDROMES

Never odd or even Do geese see God?
Is palindrome?

RESULT (true/false)

------------

Find the Longest String

EXAMPLE

1. Hello, what's up? -> Hello 2. I like trains :3 -> trains
Find the Longest String!

RESULT

------------

Find the Largest Value

EXAMPLE

1. 1,3,10,4,6,7,8 -> 10 2. 302,17,35,66,100,1 -> 302
Find the Largest Value!

RESULT

------------

Find the Smallest Value

EXAMPLE

1. 1,3,10,4,6,7,8 -> 1 2. 302,17,35,66,100,1 -> 1
Find the Smallest Value!

RESULT

------------

by YunaAnn