Question:

Javaspcript help??????

by  |  earlier

0 LIKES UnLike

Please answer only if you know javascript.

In the following code segment, d and e are Strings. The number of characters in d is an even number greater than zero. Write code that stores in e the String formed by switching the two halves of d. For example, if d is "pushdown", then e should evaluate to "downpush".

// Enter a value to test here

String d = "";

String e;

// Enter your code here

 Tags:

   Report

1 ANSWERS


  1. <script type="text/javascript">

    var d = "pushdown";

    var e = d.slice(4)+d.slice(0,4);

    alert(e);

    </script>

    javascript slice() method basics:

    http://www.w3schools.com/jsref/jsref_sli...

You're reading: Javaspcript help??????

Question Stats

Latest activity: earlier.
This question has 1 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions