Public Questions

Ask Question

97 questions


0

Vote

3

Answers

28

View

What is the most efficient way to clone a JavaScript object? I've seen obj = eval(uneval(o)); being used, but that's non-standard and only supported by Firefox.I've done things like obj = JSON.parse(J

Dec 31

0

Vote

3

Answers

18

View

How can I loop through all the entries in an array using JavaScript?I thought it was something like this:forEach(instance in theArray)Where theArray is my array, but this seems to be incorrect.

Dec 31

0

Vote

6

Answers

20

View

ECMAScript 6 introduced the let statement.I've heard that it's described as a local variable, but I'm still not quite sure how it behaves differently than the var keyword.What are the differences?. Wh

Dec 31

0

Vote

3

Answers

16

View

I have a function foo that makes an asynchronous request. How can I return the response/result from foo?I am trying to return the value from the callback, as well as assigning the result to a local va

Dec 31

0

Vote

3

Answers

19

View

Say I create an object as follows:let myObject = { "ircEvent": "PRIVMSG", "method": "newURI", "regex": "^http://.*", }; How should I remove the property regex to end up with new myObject as

Dec 31

0

Vote

3

Answers

21

View

I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features, and also trying to tidy up the code and make it more consistent.The previous developer used two ways

Dec 31

0

Vote

2

Answers

19

View

How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables, and the like), but who does not understand closures themselves?

Dec 31

0

Vote

2

Answers

253

View

I have a monorepo managed by Yarn, I'd like to take advantage of the Docker cache layers to speed up my builds, to do so I'd like to first copy the package.json and yarn.lock files, run yarn install a

Dec 29

0

Vote

2

Answers

16

View

My flutter app is going to have a feed of posts from users. I have posted in my firebase firestore database from my swift app that I am going to replace. So for I have this in my flutter fetch posts f

0

Vote

2

Answers

16

View

I sometimes build my Html website and need to add a few things after I finish which I didn't expect to put at the beginning for example like an image between the lines so I just open img tag and put t
html css 

Dec 28

0

Vote

3

Answers

98

View

I am learning Exception handling in java. I just want to know, does the finally() block always get executed in Java Exception Handling?this code in java, can I be absolutely sure that the finally bloc

Dec 27

0

Vote

3

Answers

22

View

Usually, I would expect a String.contains() method, but there doesn't seem to be one.What is a reasonable way to check for this?

Dec 23

0

Vote

3

Answers

125

View

How can I redirect the user from one page to another using jQuery or pure JavaScript?How to automatically redirect a Web Page to another URL using jQuery or pure JavaScript?

Dec 21

0

Vote

1

Answers

30

View

As of late, I run a portion of my JavaScript code through Crockford's JSLint, and it gave the following error:The problem at line 1 character 1: Missing "use strict" statement.After doing some searchi

Dec 21

0

Vote

2

Answers

28

View

Is it possible to toggle the visibility of an element, using the functions .hide(), .show() or .toggle()?How would you test if an element is visible or hidden?

Dec 20

0

Vote

1

Answers

29

View

I have a javascript array of numbers and I add numbers elements in an array using the push() method. Is there any simple way to remove a specific item or ​element from a javascript array?I'm lo

Dec 20

0

Vote

2

Answers

105

View

I am trying to remove a webhook to discord in gitlab.com for a particular project.Seems that this option is existing for a project group in a form of Reset a button, but I can't find this for a single

Nov 28

0

Vote

3

Answers

106

View

I had this working before :echo ini_get("memory_limit")."\n"; ini_set("memory_limit","256M"); echo ini_get("memory_limit")."\n";I checked the PHP documentation and googled it, and I did not find any

Nov 27

0

Vote

2

Answers

51

View

How to get the Laravel version and where is it defined?Is the Laravel version is defined inside my application directory or somewhere in the global server-side directory?The goal is to investigate, wh

0

Vote

3

Answers

46

View

I have an array like:$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); echo native_function($array, 0); // bar echo native_function($array, 1); // bin echo native_funct
php array 

Nov 27

0

Vote

3

Answers

65

View

In a form on a PHP page, you can use:In the action attribute of the form. Since echo $_SERVER['PHP_SELF'] does not pass variables for using GET and you have to use "", why would you use that or "#"?No
php form 

0

Vote

2

Answers

48

View

How to get the last indexed id or last inserted record id?how can I retrieve the last row and use it to insert it into the other table? I tried $mysqli->insert_id; then binding but it doesn't work.
php mysql 

Nov 27

0

Vote

4

Answers

444

View

I have a website in core PHP and I get error like thisWarning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, string givenCode$query = "SELECT * FROM questions WHERE id='question' LIMIT
php mysql 

Nov 27

0

Vote

2

Answers

63

View

How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP? I researched for this and find that I can do this with  $_SERVER  but I do not know how to use this.Pleas

Nov 27

0

Vote

2

Answers

40

View

How to use the time function in PHP language? Give me a different way of format and examples of time function.Which PHP function can return the current date/time?Thank You in advance

0

Vote

3

Answers

232

View

I have a custom PHP website for my blog system. I want to replace my all space from the user name with an underscore using PHP script.Please suggest to me the best way to replace spaces with underscor
php 

Nov 27

0

Vote

2

Answers

87

View

I have page one with the name (page1.php). I want to get data from page2.php in JSON.How I can do this on page2.php to return JSON.Another thing that could help me if answered, lately I've been retrie
php json 

Nov 27

0

Vote

2

Answers

350

View

I want to get a PHP class name without the use of namespace and without using reflection.namespace CRMPiccoBundle\Services\RFC\Webhook; class TicketCancelled extends Base implements Interface {
php oop class 

0

Vote

1

Answers

105

View

I want to beautify my blog url like a WordPress website. The user enters their text in the input box with id #input_title and JQuery or JavaScript converts the string and places it in an input fi

Nov 27

0

Vote

1

Answers

54

View

How to use Date and time functions in PHP?I want to find different formats for date and time using the date() function.Thank You

Nov 27