in Education by
Which of the following function is used as a consequence of not including semicolons, commas or whitespace in the Cookie value? (a) encodeURIComponent() (b) encodeURI() (c) encodeComponent() (d) encode() This question was posed to me in a job interview. My doubt stems from Cookies in portion Document Object Model and Event Handling in Javascript of JavaScript Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
The correct choice is (a) encodeURIComponent() For explanation: Cookie values cannot include semicolons, commas, or whitespace. For this reason, you may want to use the core JavaScript global function encodeURIComponent() to encode the value before storing it in the cookie.

Related questions

0 votes
0 votes
    Which attribute is used to extend the lifetime of a cookie? (a) higher-age (b) increase-age (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    Which of the following defines the Cookie visibility? (a) domain Path (b) local & session storage (c ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Which of the following is a boolean cookie attribute? (a) bool (b) secure (c) lookup (d) domain ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Which of the following is not the value the key property will hold if the key is a function key? ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
    The Cookie manipulation is done using which property? (a) cookie (b) cookies (c) manipulate (d) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    What is the maximum size of cookie? (a) 4 KB (b) 4 MB (c) 4 bytes (d) 40 KB This ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    How can you set a Cookie visibility scope to localStorage? (a) / (b) % (c) * (d) // I ... questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Which is the function used to retrieve a value? (a) get() (b) retrieve() (c) getItem() (d ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    Which function is used to clear the timer value? (a) clearTimervalue() (b) clearTimeout() (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 22, 2021 in Education by JackTerrance
0 votes
0 votes
    A function with no return value is called ___________ (a) Procedures (b) Method (c) Static function ( ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
0 votes
    JavaScript _________ when there is an indefinite or an infinite value during an arithmetic computation. (a) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
...