Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7996755
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:47:05+00:00 2026-06-04T14:47:05+00:00

function test() { alert(Array.join.call(arguments,’/’)) //alerts / alert(Array.prototype.join.call(arguments,’/’)) //alerts Js/JScript alert(Array.join(arguments,’/’)) //alerts Js/JScript } test(‘Js’,’JScript’);

  • 0
function test()
{
alert(Array.join.call(arguments,'/')) //alerts /
alert(Array.prototype.join.call(arguments,'/')) //alerts Js/JScript
alert(Array.join(arguments,'/')) //alerts Js/JScript
}
test('Js','JScript');

Why is this difference? Why is it needed to reference prototype first ?
Also why does just Array.join gives required result even when join expects just a separator argument.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:47:06+00:00Added an answer on June 4, 2026 at 2:47 pm

    Array.join is a global function. When using call, what you pass as a first argument is the this object inside the body of the join function, then the arguments for the join function.

    js> Array.join.call(null, [1, 2], "/")   
    "1/2"
    

    Array.prototype.join is for instances of Array. Therefore, it expects this to be the actual array, which is why your second example works. Your second example amounts to calling Array.prototype.join with the this object being arguments, which is exactly arguments.join("/"). See MDN for an explanation.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this (simplification): $(li).click(function{alert(test);}); <li> <input> </li> What's the best way to bind
STORE = { item : function() { } }; STORE.item.prototype.add = function() { alert('test
why does this only alert 1 ? function test() { var myobj = {
Could someone tell me if this: $.ajax({ url: 'test.html', success: function(data) { alert(Data Loaded:
I have tried to do a test: var test = Array(); $('input[name=first_category[]]:checked').each(function() { test.push($(this).val());
function test(){ if(true){ var a = 5; } alert(a); } test(); I keep getting
suppose I have a function: function test(){} test.prototype.method01=function(){ //do something } test.prototype.method02=function(){ //how can
I have just come across this code: function test(){ //... if ( $profilerule ==
test.php includes this: echo json_encode( array( array(name=>John,time=>2pm), array(name=>2,time=>1242pm), array(name=>J231ohn,time=>2p213m), )); jQuery : $.get(test.php, function(data)
This code alerts 'test 1', then alerts 8! uri = 'http://www.scriptcopy.com/'; compareuris = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.